Skip to content

Commit

Permalink
[MIG] account_invoice_show_currency_rate: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ACheung-FactorLibre committed Aug 4, 2023
1 parent 544d5e8 commit cfa2ed4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion account_invoice_show_currency_rate/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Account Invoice Show Currency Rate",
"summary": "Show currency rate in invoices.",
"version": "13.0.1.0.2",
"version": "16.0.1.0.0",
"category": "Accounting & Finance",
"website": "https://github.com/OCA/account-invoicing",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
10 changes: 4 additions & 6 deletions account_invoice_show_currency_rate/tests/test_account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,20 @@ def setUpClass(cls):
"taxes_id": [(6, 0, [cls.account_tax.id])],
}
)

cls.account = cls.env["account.account"].create(
{
"name": "Test Account",
"code": "TEST",
"user_type_id": cls.env.ref("account.data_account_type_receivable").id,
"account_type": "asset_receivable",
"reconcile": True,
}
)
cls.other_account = cls.env["account.account"].create(
{
"name": "Test Account",
"code": "ACC",
"user_type_id": cls.env.ref(
"account.data_account_type_other_income"
).id,
"account_type": "income_other",
"reconcile": True,
}
)
Expand All @@ -62,10 +61,9 @@ def _create_currency_rate(self, currency_id, name, rate):

def _create_invoice(self, currency_id):
move_form = Form(
self.env["account.move"].with_context(default_type="out_invoice")
self.env["account.move"].with_context(default_move_type="out_invoice")
)
move_form.partner_id = self.partner
move_form.journal_id = self.journal
move_form.invoice_date = fields.Date.from_string("2000-01-01")
move_form.currency_id = currency_id
with move_form.invoice_line_ids.new() as line_form:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field name="arch" type="xml">
<field name="currency_id" position="before">
<xpath expr="//div[@name='journal_div']" position="after">
<field name="show_currency_rate_amount" invisible="1" />
<field
name="currency_rate_amount"
groups="base.group_multi_currency"
digits="[12,12]"
attrs="{'invisible':[('show_currency_rate_amount', '=', False)]}"
/>
</field>
</xpath>
</field>
</record>
</odoo>

0 comments on commit cfa2ed4

Please sign in to comment.