portal/models/res_partner.py
Данил Воробьев c5833477ca initial commit
2024-05-03 09:57:08 +00:00

21 lines
607 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class ResPartner(models.Model):
_inherit = 'res.partner'
def _can_edit_name(self):
""" Name can be changed more often than the VAT """
self.ensure_one()
return True
def can_edit_vat(self):
""" `vat` is a commercial field, synced between the parent (commercial
entity) and the children. Only the commercial entity should be able to
edit it (as in backend)."""
self.ensure_one()
return not self.parent_id