mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[MIG] account_move_template: Migration to 17.0
- Fix new lints. - Simplify the way to define modifiers as states, required, readonly, invisible and column_invisible as part of [1]. [1] https://github.com/odoo/odoo/pull/104741
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
|
||||
{
|
||||
"name": "Account Move Template",
|
||||
"version": "16.0.1.0.0",
|
||||
"category": "Accounting",
|
||||
"version": "17.0.1.0.0",
|
||||
"category": "Accounting/Accounting",
|
||||
"summary": "Templates for recurring Journal Entries",
|
||||
"author": "Agile Business Group, Aurium Technologies, Vauxoo, ForgeFlow, "
|
||||
"Akretion, Odoo Community Association (OCA)",
|
||||
|
||||
@@ -37,7 +37,7 @@ class TestAccountMoveTemplate(TransactionCase):
|
||||
return True
|
||||
|
||||
def setUp(self):
|
||||
super(TestAccountMoveTemplate, self).setUp()
|
||||
super().setUp()
|
||||
employees_group = self.env.ref("base.group_user")
|
||||
multi_company_group = self.env.ref("base.group_multi_company")
|
||||
account_user_group = self.env.ref("account.group_account_user")
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
<field name="move_line_type" />
|
||||
<field name="type" />
|
||||
<field name="note" />
|
||||
<field name="tax_line_id" invisible="1" />
|
||||
<field name="tax_line_id" column_invisible="1" />
|
||||
<field
|
||||
name="tax_ids"
|
||||
widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
/>
|
||||
<field name="payment_term_id" />
|
||||
<field name="company_id" invisible="1" />
|
||||
<field name="company_currency_id" invisible="1" />
|
||||
<field name="company_id" column_invisible="1" />
|
||||
<field name="company_currency_id" column_invisible="1" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -55,7 +55,7 @@
|
||||
<field name="tax_line_id" />
|
||||
<field
|
||||
name="tax_repartition_line_id"
|
||||
attrs="{'invisible': [('tax_line_id','=',False)]}"
|
||||
invisible="not tax_line_id"
|
||||
/>
|
||||
<field name="tax_ids" widget="many2many_tags" />
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<div
|
||||
name="python_code_help"
|
||||
colspan="2"
|
||||
attrs="{'invisible': [('type', '!=', 'computed')]}"
|
||||
invisible="type != 'computed'"
|
||||
>
|
||||
<p
|
||||
>You can refer to other lines using their sequence number e.g. <i
|
||||
@@ -83,7 +83,8 @@
|
||||
</div>
|
||||
<field
|
||||
name="python_code"
|
||||
attrs="{'invisible': [('type', '!=', 'computed')], 'required': [('type', '=', 'computed')]}"
|
||||
invisible="type != 'computed'"
|
||||
required="type == 'computed'"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
@@ -109,7 +110,7 @@
|
||||
name="web_ribbon"
|
||||
title="Archived"
|
||||
bg_color="bg-danger"
|
||||
attrs="{'invisible': [('active', '=', True)]}"
|
||||
invisible="active"
|
||||
/>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only" />
|
||||
|
||||
@@ -73,7 +73,7 @@ Valid dictionary to overwrite template lines:
|
||||
overwrite_vals = self._get_overwrite_vals()
|
||||
amtlro = self.env["account.move.template.line.run"]
|
||||
tmpl_lines = self.template_id.line_ids
|
||||
for tmpl_line in tmpl_lines.filtered(lambda l: l.type == "input"):
|
||||
for tmpl_line in tmpl_lines.filtered(lambda line: line.type == "input"):
|
||||
vals = self._prepare_wizard_line(tmpl_line)
|
||||
amtlro.create(vals)
|
||||
self.write(
|
||||
|
||||
@@ -9,22 +9,22 @@
|
||||
<field
|
||||
name="template_id"
|
||||
widget="selection"
|
||||
attrs="{'readonly': [('state', '=', 'set_lines')]}"
|
||||
readonly="state == 'set_lines'"
|
||||
/>
|
||||
<field
|
||||
name="overwrite"
|
||||
widget="ace"
|
||||
options="{'mode': 'python'}"
|
||||
attrs="{'invisible': [('state', '=', 'set_lines')]}"
|
||||
invisible="state == 'set_lines'"
|
||||
/>
|
||||
<field name="company_id" invisible="1" />
|
||||
<field name="company_id" groups="base.group_multi_company" />
|
||||
<field name="date" states="set_lines" />
|
||||
<field name="journal_id" states="set_lines" />
|
||||
<field name="ref" states="set_lines" />
|
||||
<field name="partner_id" states="set_lines" />
|
||||
<field name="date" invisible="state != 'set_lines'" />
|
||||
<field name="journal_id" invisible="state != 'set_lines'" />
|
||||
<field name="ref" invisible="state != 'set_lines'" />
|
||||
<field name="partner_id" invisible="state != 'set_lines'" />
|
||||
</group>
|
||||
<group name="lines" states="set_lines">
|
||||
<group name="lines" invisible="state != 'set_lines'">
|
||||
<field name="line_ids" nolabel="1" colspan="2">
|
||||
<tree editable="bottom">
|
||||
<field name="sequence" invisible="1" />
|
||||
@@ -39,14 +39,11 @@
|
||||
widget="analytic_distribution"
|
||||
groups="analytic.group_analytic_accounting"
|
||||
/>
|
||||
<field
|
||||
name="tax_line_id"
|
||||
attrs="{'invisible': [('tax_line_id','=',False)]}"
|
||||
/>
|
||||
<field name="tax_line_id" invisible="not tax_line_id" />
|
||||
<field
|
||||
name="tax_ids"
|
||||
widget="many2many_tags"
|
||||
attrs="{'invisible': [('tax_ids','=',[])]}"
|
||||
invisible="not tax_ids"
|
||||
/>
|
||||
<field name="move_line_type" />
|
||||
<field name="amount" />
|
||||
@@ -63,14 +60,14 @@
|
||||
class="btn-primary"
|
||||
string="Next"
|
||||
type="object"
|
||||
states="select_template"
|
||||
invisible="state != 'select_template'"
|
||||
/>
|
||||
<button
|
||||
name="generate_move"
|
||||
class="btn-primary"
|
||||
string="Create Journal Entry"
|
||||
type="object"
|
||||
states="set_lines"
|
||||
invisible="state != 'set_lines'"
|
||||
/>
|
||||
<button special="cancel" string="Cancel" class="btn-default" />
|
||||
</footer>
|
||||
|
||||
Reference in New Issue
Block a user