Merge PR #903 into 14.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2022-03-08 17:03:27 +00:00
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>