File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1
1
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2
2
3
+ from . import account_payment_line
3
4
from . import account_payment_method
4
5
from . import account_payment_order
Original file line number Diff line number Diff line change
1
+ # Copyright 2025 Giuseppe Borruso - Dinamiche Aziendali srl
2
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3
+
4
+ from odoo import fields , models
5
+
6
+
7
+ class AccountPaymentLineInherit (models .Model ):
8
+ _inherit = "account.payment.line"
9
+
10
+ def _prepare_account_payment_vals (self ):
11
+ vals = super ()._prepare_account_payment_vals ()
12
+ if self .order_id .payment_method_id .code == "sepa_cbi_credit_transfer" :
13
+ today = fields .Date .context_today (self )
14
+
15
+ if self .order_id .date_prefered == "due" :
16
+ requested_date = self [:1 ].ml_maturity_date or self [:1 ].date or today
17
+ elif self .order_id .date_prefered == "fixed" :
18
+ requested_date = self .order_id .date_scheduled or today
19
+ else :
20
+ requested_date = fields .Date .context_today (self )
21
+ vals ["date" ] = requested_date
22
+ return vals
You can’t perform that action at this time.
0 commit comments