summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2019-07-04 15:34:48 +0000
committerLucas Perais (lpe) <lpe@odoo.com>2019-07-05 07:31:12 +0000
commitccb8896fe348b99ca64efd741140dae104f7793e (patch)
tree902d9e533eacd6e49de6c08aeafea7c5f0db70fe
parentf8e41c6b00131bf387843c24d1003310cde92a5e (diff)
[FIX] account: introduce a form view for account.move.line for mobile
On a small display, go to accounting > journal entries > create In the (now kanban) list of account move lines, click ADD Then, try to choose an account Before this commit: The list of accounts was empty. This was because the form view spawned was the automatic generic one The generated view did not have thr necessary structure to get fields' value from the parent form view. In this case, the domain of the name_search for account.account was wrong After this commit: The flow works on mobile as on desktop. The form view's arch is a 1 to 1 copy of the list view in terms of fields and their definition OPW 2030837 closes odoo/odoo#34601 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
-rw-r--r--addons/account/views/account_view.xml21
1 files changed, 21 insertions, 0 deletions
diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml
index c24518e15b8..f14a7701011 100644
--- a/addons/account/views/account_view.xml
+++ b/addons/account/views/account_view.xml
@@ -1623,6 +1623,27 @@
<field name="recompute_tax_line" invisible="1" readonly="1"/>
<field name="tax_line_grouping_key" invisible="1" readonly="1"/>
</tree>
+ <!-- Form view to cover mobile use -->
+ <form>
+ <group>
+ <field name="tax_line_id" invisible="1"/>
+ <field name="account_id" domain="[('company_id', '=', parent.company_id), ('deprecated', '=', False)]"/>
+ <field name="partner_id" domain="['|', ('parent_id', '=', False), ('is_company', '=', True)]"/>
+ <field name="name"/>
+ <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
+ <field name="analytic_tag_ids" groups="analytic.group_analytic_tags" widget="many2many_tags"/>
+ <field name="amount_currency" groups="base.group_multi_currency"/>
+ <field name="company_currency_id" invisible="1"/>
+ <field name="company_id" invisible="1"/>
+ <field name="currency_id" options="{'no_create': True}" groups="base.group_multi_currency"/>
+ <field name="debit" sum="Total Debit"/>
+ <field name="credit" sum="Total Credit"/>
+ <field name="tax_ids" string="Taxes Applied" widget="many2many_tags" domain="[('type_tax_use', '=?', parent.tax_type_domain)]" context="{'append_type_to_tax_name': not parent.tax_type_domain}" options="{'no_create': True}"/>
+ <field name="date_maturity" required="0" invisible="context.get('view_no_maturity', False)"/>
+ <field name="recompute_tax_line" invisible="1" readonly="1"/>
+ <field name="tax_line_grouping_key" invisible="1" readonly="1"/>
+ </group>
+ </form>
</field>
<field name="narration" colspan="4" placeholder="Add an internal note..." nolabel="1" height="50"/>
</page>