From fc4fe95efc291a4f3078f34f5c564f2838f0cd69 Mon Sep 17 00:00:00 2001 From: Alicia Garzo Moreno Date: Mon, 11 Mar 2024 14:42:38 +0100 Subject: [PATCH] [16.0][IMP] contract and contract_sale_generation: Add translations --- contract/i18n/es.po | 7 +++++++ contract/models/abstract_contract.py | 6 +----- contract_sale_generation/i18n/es.po | 10 +++++++--- contract_sale_generation/models/abstract_contract.py | 10 ++++------ 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/contract/i18n/es.po b/contract/i18n/es.po index 0882c907d..ab1766b16 100644 --- a/contract/i18n/es.po +++ b/contract/i18n/es.po @@ -2427,6 +2427,13 @@ msgstr "" "{{ object.company_id.name }} Contrato (Ref {{ object.name or 'n/a' }}) - " "Modificaciones" +#. module: contract +#: model:ir.model.fields.selection,name:contract.selection__contract_abstract_contract__generation_type__invoice +#: model:ir.model.fields.selection,name:contract.selection__contract_contract__generation_type__invoice +#: model:ir.model.fields.selection,name:contract.selection__contract_template__generation_type__invoice +msgid "Invoice" +msgstr "Factura" + #~ msgid "Analytic account" #~ msgstr "Cuenta analítica" diff --git a/contract/models/abstract_contract.py b/contract/models/abstract_contract.py index e8c82f000..70210cec1 100644 --- a/contract/models/abstract_contract.py +++ b/contract/models/abstract_contract.py @@ -51,15 +51,11 @@ class ContractAbstractContract(models.AbstractModel): " of all together for the whole contract.", ) generation_type = fields.Selection( - selection=lambda self: self._selection_generation_type(), + selection=[("invoice", "Invoice")], default=lambda self: self._default_generation_type(), help="Choose the document that will be automatically generated by cron.", ) - @api.model - def _selection_generation_type(self): - return [("invoice", "Invoice")] - @api.model def _default_generation_type(self): return "invoice" diff --git a/contract_sale_generation/i18n/es.po b/contract_sale_generation/i18n/es.po index 5f632bbee..b81fbb47f 100644 --- a/contract_sale_generation/i18n/es.po +++ b/contract_sale_generation/i18n/es.po @@ -95,12 +95,16 @@ msgstr "" "Se trata de un campo técnico para saber si la orden debe confirmarse " "automáticamente si se genera por contrato." +#. module: contract_sale_generation +#: model:ir.model.fields.selection,name:contract_sale_generation.selection__contract_abstract_contract__generation_type__sale +#: model:ir.model.fields.selection,name:contract_sale_generation.selection__contract_contract__generation_type__sale +#: model:ir.model.fields.selection,name:contract_sale_generation.selection__contract_template__generation_type__sale +msgid "Sale" +msgstr "Venta" + #~ msgid "Invoice" #~ msgstr "Factura" -#~ msgid "Sale" -#~ msgstr "Venta" - #~ msgid "Type" #~ msgstr "Tipo" diff --git a/contract_sale_generation/models/abstract_contract.py b/contract_sale_generation/models/abstract_contract.py index b5d7dcd62..f9b56e3a5 100644 --- a/contract_sale_generation/models/abstract_contract.py +++ b/contract_sale_generation/models/abstract_contract.py @@ -2,7 +2,7 @@ # Copyright 2017 Angel Moya # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models +from odoo import fields, models class ContractAbstractContract(models.AbstractModel): @@ -10,8 +10,6 @@ class ContractAbstractContract(models.AbstractModel): sale_autoconfirm = fields.Boolean() - @api.model - def _selection_generation_type(self): - res = super()._selection_generation_type() - res.append(("sale", "Sale")) - return res + generation_type = fields.Selection( + selection_add=[("sale", "Sale")], + )