2021-03-12 16:21:19 +00:00
|
|
|
# Copyright 2014 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
|
|
|
|
# Copyright 2014 Tecnativa - Pedro M. Baeza
|
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
|
|
|
|
from flectra import api, fields, models
|
|
|
|
|
|
|
|
|
|
|
|
class ResPartner(models.Model):
|
|
|
|
_inherit = "res.partner"
|
|
|
|
|
|
|
|
supplier_payment_mode_id = fields.Many2one(
|
2021-06-06 02:13:20 +00:00
|
|
|
comodel_name="account.payment.mode",
|
2021-03-12 16:21:19 +00:00
|
|
|
company_dependent=True,
|
2021-12-12 03:12:37 +00:00
|
|
|
check_company=True,
|
2023-05-19 08:19:51 +00:00
|
|
|
domain="[('payment_type', '=', 'outbound'),"
|
|
|
|
"('company_id', '=', current_company_id)]",
|
2021-03-12 16:21:19 +00:00
|
|
|
help="Select the default payment mode for this supplier.",
|
|
|
|
)
|
|
|
|
customer_payment_mode_id = fields.Many2one(
|
2021-06-06 02:13:20 +00:00
|
|
|
comodel_name="account.payment.mode",
|
2021-03-12 16:21:19 +00:00
|
|
|
company_dependent=True,
|
2021-12-12 03:12:37 +00:00
|
|
|
check_company=True,
|
2023-05-19 08:19:51 +00:00
|
|
|
domain="[('payment_type', '=', 'inbound'),"
|
|
|
|
"('company_id', '=', current_company_id)]",
|
2021-03-12 16:21:19 +00:00
|
|
|
help="Select the default payment mode for this customer.",
|
|
|
|
)
|
|
|
|
|
|
|
|
@api.model
|
|
|
|
def _commercial_fields(self):
|
|
|
|
res = super()._commercial_fields()
|
|
|
|
res += ["supplier_payment_mode_id", "customer_payment_mode_id"]
|
|
|
|
return res
|