Skip to content

Commit

Permalink
[MIG] sale_automatic_workflow: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chaule97 committed Nov 29, 2024
1 parent ff38d00 commit c6a93d6
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 36 deletions.
1 change: 1 addition & 0 deletions sale_automatic_workflow/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Contributors
- Phuc Tran Thanh <phuc@trobz.com>
- Sander Lienaerts <sander.lienaerts@codeforward.nl>
- Tri Doan <tridm@trobz.com>
- Chau Le <chaulb@trobz.com>

Other credits
-------------
Expand Down
2 changes: 1 addition & 1 deletion sale_automatic_workflow/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{
"name": "Sale Automatic Workflow",
"version": "17.0.1.1.0",
"version": "18.0.0.1.0",
"category": "Sales Management",
"license": "AGPL-3",
"author": "Akretion, "
Expand Down
6 changes: 2 additions & 4 deletions sale_automatic_workflow/data/automatic_workflow_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,12 @@
</record>
<record forcecreate="True" id="ir_cron_automatic_workflow_job" model="ir.cron">
<field name="name">Automatic Workflow Job</field>
<field ref="model_automatic_workflow_job" name="model_id" />
<field name="model_id" ref="model_automatic_workflow_job" />
<field name="state">code</field>
<field name="code">model.run()</field>
<field eval="True" name="active" />
<field name="active" eval="True" />
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
</record>
</odoo>
2 changes: 1 addition & 1 deletion sale_automatic_workflow/models/automatic_workflow_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _register_payment_invoice(self, invoice):
("account_type", "in", ("asset_receivable", "liability_payable")),
("reconciled", "=", False),
]
payment_lines = payment.line_ids.filtered_domain(domain)
payment_lines = payment.move_id.line_ids.filtered_domain(domain)
lines = invoice.line_ids
for account in payment_lines.account_id:
(payment_lines + lines).filtered_domain(
Expand Down
4 changes: 2 additions & 2 deletions sale_automatic_workflow/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2016 Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models
from odoo import api, fields, models
from odoo.tools import float_compare


Expand Down Expand Up @@ -55,7 +55,7 @@ def _prepare_invoice(self):
def _onchange_workflow_process_id(self):
if self.workflow_process_id.warning:
warning = {
"title": _("Workflow Warning"),
"title": self.env._("Workflow Warning"),
"message": self.workflow_process_id.warning,
}
return {"warning": warning}
Expand Down
1 change: 1 addition & 0 deletions sale_automatic_workflow/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
- Phuc Tran Thanh \<<phuc@trobz.com>\>
- Sander Lienaerts \<<sander.lienaerts@codeforward.nl>\>
- Tri Doan \<<tridm@trobz.com>\>
- Chau Le \<<chaulb@trobz.com>\>
1 change: 1 addition & 0 deletions sale_automatic_workflow/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<li>Phuc Tran Thanh &lt;<a class="reference external" href="mailto:phuc&#64;trobz.com">phuc&#64;trobz.com</a>&gt;</li>
<li>Sander Lienaerts &lt;<a class="reference external" href="mailto:sander.lienaerts&#64;codeforward.nl">sander.lienaerts&#64;codeforward.nl</a>&gt;</li>
<li>Tri Doan &lt;<a class="reference external" href="mailto:tridm&#64;trobz.com">tridm&#64;trobz.com</a>&gt;</li>
<li>Chau Le &lt;<a class="reference external" href="mailto:chaulb&#64;trobz.com">chaulb&#64;trobz.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="other-credits">
Expand Down
40 changes: 16 additions & 24 deletions sale_automatic_workflow/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,36 +86,28 @@ def setUpClass(cls, chart_template_ref=None):
_job_force_sync=True,
)
)
cls.company_fr = cls.setup_company_data(
{
"name": "French company",
"currency_id": cls.env.ref("base.EUR").id,
"country_id": cls.env.ref("base.fr").id,
}
cls.company_fr = cls.setup_other_company(
name="French company",
currency_id=cls.env.ref("base.EUR").id,
country_id=cls.env.ref("base.fr").id,
)["company"]

cls.company_ch = cls.setup_company_data(
{
"name": "Swiss company",
"currency_id": cls.env.ref("base.CHF").id,
"country_id": cls.env.ref("base.ch").id,
}
cls.company_ch = cls.setup_other_company(
name="Swiss company",
currency_id=cls.env.ref("base.CHF").id,
country_id=cls.env.ref("base.ch").id,
)["company"]

cls.company_be = cls.setup_company_data(
{
"name": "Belgian company",
"currency_id": cls.env.ref("base.EUR").id,
"country_id": cls.env.ref("base.be").id,
}
cls.company_be = cls.setup_other_company(
name="Belgian company",
currency_id=cls.env.ref("base.EUR").id,
country_id=cls.env.ref("base.be").id,
)["company"]

cls.company_fr_daughter = cls.setup_company_data(
{
"name": "French company daughter",
"currency_id": cls.env.ref("base.EUR").id,
"country_id": cls.env.ref("base.fr").id,
}
cls.company_fr_daughter = cls.setup_other_company(
name="French company daughter",
currency_id=cls.env.ref("base.EUR").id,
country_id=cls.env.ref("base.fr").id,
)["company"]

cls.env.user.company_ids |= cls.company_fr
Expand Down
8 changes: 4 additions & 4 deletions sale_automatic_workflow/views/sale_workflow_process_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -290,23 +290,23 @@
</field>
</record>
<record id="sale_workflow_process_view_tree" model="ir.ui.view">
<field name="name">sale_automic_workflow.sale_workflow_process.view_tree</field>
<field name="name">sale_automic_workflow.sale_workflow_process.view_list</field>
<field name="model">sale.workflow.process</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="name" />
<field name="team_id" />
<field name="validate_order" />
<field name="validate_invoice" />
<field name="register_payment" />
<field name="invoice_date_is_order_date" />
</tree>
</list>
</field>
</record>
<record id="act_sale_workflow_process_form" model="ir.actions.act_window">
<field name="name">Automatic Workflow</field>
<field name="res_model">sale.workflow.process</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>
<menuitem
id="menu_sale_workflow_parent"
Expand Down

0 comments on commit c6a93d6

Please sign in to comment.