Skip to content

Commit 6f764d6

Browse files
committed
[ADD] l10n_it_sct_cbi: aggiunta PR OCA#4706
1 parent 9b43d59 commit 6f764d6

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

l10n_it_sct_cbi/models/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
22

3+
from . import account_payment_line
34
from . import account_payment_method
45
from . import account_payment_order
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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.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

0 commit comments

Comments
 (0)