Skip to content

Commit

Permalink
[ADD] account_ux: Fix inherit view
Browse files Browse the repository at this point in the history
We were trying to modify the debit_origin_id field for the original view
of account.move and not from actually the account_debit_note view that
is actually adding the field.

In this case, Odoo resolves it and does not show any warning or error
when loading the view, but we need this fix because this is causing an
error when installing or updating the module.

closes #333

Signed-off-by: Katherine Zaoral <[email protected]>
  • Loading branch information
zaoral committed Feb 22, 2022
1 parent e8b04d5 commit 9a98c2d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion account_ux/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Account UX',
'version': "13.0.1.23.0",
'version': "13.0.1.24.0",
'category': 'Accounting',
'sequence': 14,
'summary': '',
Expand Down
11 changes: 9 additions & 2 deletions account_ux/views/account_move_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,20 @@
<attribute name="force_save">1</attribute>
</field>

</field>
</record>

<record id="view_move_form_debit" model="ir.ui.view">
<field name="model">account.move</field>
<field name="name">account.move.form</field>
<field name="inherit_id" ref="account_debit_note.view_move_form_debit"/>
<field name="arch" type="xml">

<!-- permitimos modificar "Factura origne de la ND" para poder vincular ND creadas a mano -->
<xpath expr="//group[@name='sale_info_group']/field[@name='debit_origin_id']" position="attributes">
<!-- <attribute name="attrs"></attribute> -->
<attribute name="attrs">{'invisible': [('type', '!=', 'out_invoice')], 'readonly': [('state', '!=', 'draft')]}</attribute>
<attribute name="domain">[('type', 'in', ('out_invoice', 'out_refund')), ('partner_id.commercial_partner_id', '=', commercial_partner_id), ('state', '=', 'posted')]</attribute>
</xpath>

</field>
</record>

Expand Down

0 comments on commit 9a98c2d

Please sign in to comment.