[IMP] account_payment_order: don't requiere reference_type anymore

This commit is contained in:
Miquel Raïch
2022-03-08 14:23:09 +01:00
parent 0c760d50de
commit af433396ff
2 changed files with 3 additions and 3 deletions

View File

@@ -57,7 +57,7 @@ class AccountMoveLine(models.Model):
communication = self.ref or self.name
# change these default values if move line is linked to an invoice
if self.move_id.is_invoice():
if self.move_id.reference_type != "none":
if (self.move_id.reference_type or "none") != "none":
communication = self.move_id.ref
ref2comm_type = aplo.invoice_reference_type2communication_type()
communication_type = ref2comm_type[self.move_id.reference_type]

View File

@@ -45,9 +45,9 @@
<field name="payment_reference" position="before">
<field
name="reference_type"
required="1"
attrs="{'readonly':[('state','!=','draft')],
'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}"
'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))],
'required': [('move_type', 'in', ('out_invoice', 'out_refund'))]}"
/>
</field>
</field>