Skip to content

Commit

Permalink
[FIX] l10n_cl_edi_special_fields: change visibility or requirement de…
Browse files Browse the repository at this point in the history
…pending on document type
  • Loading branch information
Danisan committed Apr 19, 2021
1 parent 7e71f84 commit b540192
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 0 additions & 2 deletions l10n_cl_edi_special_fields/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ class AccountMove(models.Model):

partner_invoice_id = fields.Many2one(
'res.partner', string='Dirección de Facturación',
readonly=True, required=True,
states={'draft': [('readonly', False)]},
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id), ('parent_id', '=', partner_id)]", )

@api.onchange('partner_id')
Expand Down
5 changes: 4 additions & 1 deletion l10n_cl_edi_special_fields/views/account_move_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
<field name="inherit_id" ref="sale.account_invoice_form" />
<field name="arch" type="xml">
<field name="partner_shipping_id" position="before">
<field name="partner_invoice_id"/>
<field name="partner_invoice_id" attrs="{
'required': [('state', '=', 'draft'), ('move_type', 'in', ['in_refund', 'out_refund'])],
'readonly': [('state', '!=', 'draft')],
'invisible': [('move_type', 'not in', ['in_refund', 'out_refund'])]}"/>
</field>
</field>
</record>
Expand Down

0 comments on commit b540192

Please sign in to comment.