diff --git a/sale_order_partner_invoice_period/i18n/es.po b/sale_order_partner_invoice_period/i18n/es.po index 251bf48..61c49f3 100644 --- a/sale_order_partner_invoice_period/i18n/es.po +++ b/sale_order_partner_invoice_period/i18n/es.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 17.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 14:49+0000\n" -"PO-Revision-Date: 2024-11-20 14:49+0000\n" +"POT-Creation-Date: 2024-11-22 10:06+0000\n" +"PO-Revision-Date: 2024-11-22 10:06+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -22,11 +22,13 @@ msgstr "Contacto" #. module: sale_order_partner_invoice_period #: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__res_partner__invoice_period__daily +#: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__sale_order__partner_invoice_period__daily msgid "Daily" msgstr "Diario" #. module: sale_order_partner_invoice_period #: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__res_partner__invoice_period__fortnightly +#: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__sale_order__partner_invoice_period__fortnightly msgid "Fortnightly" msgstr "Quincenal" @@ -39,11 +41,13 @@ msgstr "Periodo de facturación" #. module: sale_order_partner_invoice_period #: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__res_partner__invoice_period__monthly +#: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__sale_order__partner_invoice_period__monthly msgid "Monthly" msgstr "Mensual" #. module: sale_order_partner_invoice_period #: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__res_partner__invoice_period__quarterly +#: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__sale_order__partner_invoice_period__quarterly msgid "Quarterly" msgstr "Trimestral" @@ -54,10 +58,12 @@ msgstr "Pedido de venta" #. module: sale_order_partner_invoice_period #: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__res_partner__invoice_period__weekly +#: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__sale_order__partner_invoice_period__weekly msgid "Weekly" msgstr "Semanal" #. module: sale_order_partner_invoice_period #: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__res_partner__invoice_period__yearly +#: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__sale_order__partner_invoice_period__yearly msgid "Yearly" msgstr "Anual" diff --git a/sale_order_partner_invoice_period/i18n/sale_order_partner_invoice_period.pot b/sale_order_partner_invoice_period/i18n/sale_order_partner_invoice_period.pot index 7583986..436de38 100644 --- a/sale_order_partner_invoice_period/i18n/sale_order_partner_invoice_period.pot +++ b/sale_order_partner_invoice_period/i18n/sale_order_partner_invoice_period.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 17.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-11-20 14:48+0000\n" -"PO-Revision-Date: 2024-11-20 14:48+0000\n" +"POT-Creation-Date: 2024-11-22 10:06+0000\n" +"PO-Revision-Date: 2024-11-22 10:06+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -22,11 +22,13 @@ msgstr "" #. module: sale_order_partner_invoice_period #: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__res_partner__invoice_period__daily +#: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__sale_order__partner_invoice_period__daily msgid "Daily" msgstr "" #. module: sale_order_partner_invoice_period #: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__res_partner__invoice_period__fortnightly +#: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__sale_order__partner_invoice_period__fortnightly msgid "Fortnightly" msgstr "" @@ -39,11 +41,13 @@ msgstr "" #. module: sale_order_partner_invoice_period #: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__res_partner__invoice_period__monthly +#: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__sale_order__partner_invoice_period__monthly msgid "Monthly" msgstr "" #. module: sale_order_partner_invoice_period #: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__res_partner__invoice_period__quarterly +#: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__sale_order__partner_invoice_period__quarterly msgid "Quarterly" msgstr "" @@ -54,10 +58,12 @@ msgstr "" #. module: sale_order_partner_invoice_period #: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__res_partner__invoice_period__weekly +#: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__sale_order__partner_invoice_period__weekly msgid "Weekly" msgstr "" #. module: sale_order_partner_invoice_period #: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__res_partner__invoice_period__yearly +#: model:ir.model.fields.selection,name:sale_order_partner_invoice_period.selection__sale_order__partner_invoice_period__yearly msgid "Yearly" msgstr "" diff --git a/sale_order_partner_invoice_period/models/res_partner.py b/sale_order_partner_invoice_period/models/res_partner.py index 8cb8572..6f98c62 100644 --- a/sale_order_partner_invoice_period/models/res_partner.py +++ b/sale_order_partner_invoice_period/models/res_partner.py @@ -2,17 +2,17 @@ # License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html from odoo import models, fields +INVOICE_PERIOD_SELECTION = [ + ('daily','Daily'), + ('weekly','Weekly'), + ('fortnightly','Fortnightly'), + ('monthly','Monthly'), + ('quarterly','Quarterly'), + ('yearly','Yearly') +] + + class ResPartner(models.Model): _inherit = "res.partner" - - invoice_period = fields.Selection( - [ - ('daily','Daily'), - ('weekly','Weekly'), - ('fortnightly','Fortnightly'), - ('monthly','Monthly'), - ('quarterly','Quarterly'), - ('yearly','Yearly') - ] - ) + invoice_period = fields.Selection(INVOICE_PERIOD_SELECTION) diff --git a/sale_order_partner_invoice_period/models/sale_order.py b/sale_order_partner_invoice_period/models/sale_order.py index 66d161d..c39bcf3 100644 --- a/sale_order_partner_invoice_period/models/sale_order.py +++ b/sale_order_partner_invoice_period/models/sale_order.py @@ -1,19 +1,13 @@ # © 2024 Solvos Consultoría Informática () # License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html from odoo import models, fields, api +from .res_partner import INVOICE_PERIOD_SELECTION class SaleOrder(models.Model): _inherit = "sale.order" partner_invoice_period = fields.Selection( - selection=[ - ('daily', 'Daily'), - ('weekly', 'Weekly'), - ('fortnightly', 'Fortnightly'), - ('monthly', 'Monthly'), - ('quarterly', 'Quarterly'), - ('yearly', 'Yearly'), - ], + selection=INVOICE_PERIOD_SELECTION, compute='_compute_partner_invoice_period', string="Invoice Period", store=True diff --git a/sale_order_partner_invoice_period/views/res_partner_view.xml b/sale_order_partner_invoice_period/views/res_partner_view.xml index 8326469..1c0a8fa 100644 --- a/sale_order_partner_invoice_period/views/res_partner_view.xml +++ b/sale_order_partner_invoice_period/views/res_partner_view.xml @@ -7,7 +7,8 @@ - + + diff --git a/sale_order_partner_invoice_period/views/sale_order_view.xml b/sale_order_partner_invoice_period/views/sale_order_view.xml index c90b3d1..bda7420 100644 --- a/sale_order_partner_invoice_period/views/sale_order_view.xml +++ b/sale_order_partner_invoice_period/views/sale_order_view.xml @@ -18,9 +18,12 @@ sale.order - + + + +