mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
🐛 fix(res_partner.py): use api.model decorator for create method to avoid pylint warning
🐛 fix(res_partner.py): use values instead of vals in create method to improve semantics
This commit is contained in:
@@ -697,12 +697,13 @@ class ResPartner(models.Model):
|
||||
)
|
||||
return super().unlink()
|
||||
|
||||
def create(self, vals):
|
||||
check_missing_document = self._check_document_partner_required(vals)
|
||||
@api.model
|
||||
def create(self, values):
|
||||
check_missing_document = self._check_document_partner_required(values)
|
||||
if check_missing_document:
|
||||
raise ValidationError(_("A document identification is required"))
|
||||
|
||||
return super().create(vals)
|
||||
return super(ResPartner, self).create(values)
|
||||
|
||||
def write(self, vals):
|
||||
check_missing_document = self._check_document_partner_required(
|
||||
|
||||
@@ -277,8 +277,8 @@ class BookingEngine(models.TransientModel):
|
||||
folio.reservation_ids.reservation_line_ids.discount = (
|
||||
record.discount * 100
|
||||
)
|
||||
action = self.env.ref("pms.open_pms_folio1_form_tree_all").read()[0]
|
||||
action["views"] = [(self.env.ref("pms.pms_folio_view_form").id, "form")]
|
||||
action = self.sudo().env.ref("pms.open_pms_folio1_form_tree_all").read()[0]
|
||||
action["views"] = [(self.sudo().env.ref("pms.pms_folio_view_form").id, "form")]
|
||||
action["res_id"] = folio.id
|
||||
return action
|
||||
|
||||
|
||||
Reference in New Issue
Block a user