bank-payment/account_banking_mandate_sale_contact/models/res_partner.py

35 lines
1.4 KiB
Python
Raw Permalink Normal View History

2024-10-01 05:24:28 +00:00
# Copyright 2024 Alberto Martínez <alberto.martinez@sygel.es>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from flectra import api, fields, models
class ResPartner(models.Model):
_inherit = "res.partner"
sale_default_mandate_contact = fields.Selection(
selection=[
("partner_id", "Customer Mandate"),
("commercial_partner_id", "Commercial Customer Mandate"),
("partner_invoice_id", "Invoice Address Mandate"),
("partner_shipping_id", "Delivery Address Mandate"),
],
string="Default Sale Mandate Contact",
help="The partner of the sales in which flectra will search for the mandate\n"
"- Customer Mandate: Flectra will look the mandate in the sale partner,"
" whether is an individual or the company\n"
"- Commercial Customer Mandate: Flectra will look the mandate in the"
" sale partner company\n"
"- Invoice Address Mandate: Flectra will look the mandate in the"
" sale invoice address\n"
"- Delivery Address Mandate: Flectra will look the mandate in the"
" sale delivery address\n"
"- False: Flectra will use the company configuration option",
)
@api.model
def _commercial_fields(self):
return super()._commercial_fields() + [
"sale_default_mandate_contact",
]