[14.0][IMP] contract: Use Odoo conventions for methods

This commit is contained in:
Denis Roussel
2022-01-21 11:07:48 +01:00
parent f33112c2fc
commit 999de618ab

View File

@@ -50,17 +50,17 @@ class ContractAbstractContract(models.AbstractModel):
) )
generation_type = fields.Selection( generation_type = fields.Selection(
string="Generation Type", string="Generation Type",
selection=lambda self: self._get_generation_type_selection(), selection=lambda self: self._selection_generation_type(),
default=lambda self: self._get_default_generation_type(), default=lambda self: self._default_generation_type(),
help="Choose the document that will be automatically generated by cron.", help="Choose the document that will be automatically generated by cron.",
) )
@api.model @api.model
def _get_generation_type_selection(self): def _selection_generation_type(self):
return [("invoice", "Invoice")] return [("invoice", "Invoice")]
@api.model @api.model
def _get_default_generation_type(self): def _default_generation_type(self):
return "invoice" return "invoice"
@api.onchange("contract_type") @api.onchange("contract_type")