mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
'date_prefered' is a required field on payment orders: so, if 'date_prefered' key is present in vals but has no value, we use the default value on the payment mode
This commit is contained in:
committed by
Enric Tobella
parent
9a0216f893
commit
d3277fdd79
@@ -142,7 +142,7 @@ class AccountPaymentOrder(models.Model):
|
||||
if payment_mode.bank_account_link == 'fixed':
|
||||
vals['journal_id'] = payment_mode.fixed_journal_id.id
|
||||
if (
|
||||
'date_prefered' not in vals and
|
||||
not vals.get('date_prefered') and
|
||||
payment_mode.default_date_prefered):
|
||||
vals['date_prefered'] = payment_mode.default_date_prefered
|
||||
return super(AccountPaymentOrder, self).create(vals)
|
||||
|
||||
Reference in New Issue
Block a user