From 4885a8c5cfe2a206a219b6ac1d517b6c72550331 Mon Sep 17 00:00:00 2001 From: Alfredo Date: Wed, 25 Sep 2024 10:37:09 +0200 Subject: [PATCH] [16.0][ADD] repair_order_invoice_address: In repair orders new field "Invoice Address". --- repair_order_invoice_address/README.rst | 27 +++++++++++++++++++ repair_order_invoice_address/__init__.py | 1 + repair_order_invoice_address/__manifest__.py | 19 +++++++++++++ repair_order_invoice_address/i18n/ca_ES.po | 26 ++++++++++++++++++ repair_order_invoice_address/i18n/en_GB.po | 26 ++++++++++++++++++ repair_order_invoice_address/i18n/es.po | 26 ++++++++++++++++++ repair_order_invoice_address/i18n/fr.po | 26 ++++++++++++++++++ .../i18n/repair_order_invoice_address.pot | 26 ++++++++++++++++++ .../models/__init__.py | 1 + .../models/repair_order.py | 27 +++++++++++++++++++ .../views/mrp_repair_view.xml | 25 +++++++++++++++++ .../odoo/addons/repair_order_invoice_address | 1 + setup/repair_order_invoice_address/setup.py | 6 +++++ 13 files changed, 237 insertions(+) create mode 100644 repair_order_invoice_address/README.rst create mode 100644 repair_order_invoice_address/__init__.py create mode 100644 repair_order_invoice_address/__manifest__.py create mode 100644 repair_order_invoice_address/i18n/ca_ES.po create mode 100644 repair_order_invoice_address/i18n/en_GB.po create mode 100644 repair_order_invoice_address/i18n/es.po create mode 100644 repair_order_invoice_address/i18n/fr.po create mode 100644 repair_order_invoice_address/i18n/repair_order_invoice_address.pot create mode 100644 repair_order_invoice_address/models/__init__.py create mode 100644 repair_order_invoice_address/models/repair_order.py create mode 100644 repair_order_invoice_address/views/mrp_repair_view.xml create mode 120000 setup/repair_order_invoice_address/odoo/addons/repair_order_invoice_address create mode 100644 setup/repair_order_invoice_address/setup.py diff --git a/repair_order_invoice_address/README.rst b/repair_order_invoice_address/README.rst new file mode 100644 index 0000000..56012bd --- /dev/null +++ b/repair_order_invoice_address/README.rst @@ -0,0 +1,27 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================ +Repair order invoice address +============================ + +* In repair orders new field "Invoice Address". + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, +please check there if your issue has already been reported. If you spotted +it first, help us smash it by providing detailed and welcomed feedback. + +Credits +======= + +Contributors +------------ +* Ana Juaristi +* Alfredo de la Fuente + +Do not contact contributors directly about support or help with technical issues. diff --git a/repair_order_invoice_address/__init__.py b/repair_order_invoice_address/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/repair_order_invoice_address/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/repair_order_invoice_address/__manifest__.py b/repair_order_invoice_address/__manifest__.py new file mode 100644 index 0000000..57b132e --- /dev/null +++ b/repair_order_invoice_address/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2024 Alfredo de la Fuente - AvanzOSC +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html +{ + "name": "Repair Order Invoice Address", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "AvanzOSC", + "website": "https://github.com/avanzosc/mrp-repair-addons", + "contributors": [ + "Ana Juaristi ", + "Alfredo de la Fuente ", + ], + "category": "Inventory/Inventory", + "depends": ["repair"], + "data": [ + "views/mrp_repair_view.xml", + ], + "installable": True, +} diff --git a/repair_order_invoice_address/i18n/ca_ES.po b/repair_order_invoice_address/i18n/ca_ES.po new file mode 100644 index 0000000..6886789 --- /dev/null +++ b/repair_order_invoice_address/i18n/ca_ES.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * repair_order_invoice_address +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-09-25 08:32+0000\n" +"PO-Revision-Date: 2024-09-25 08:32+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: repair_order_invoice_address +#: model:ir.model.fields,field_description:repair_order_invoice_address.field_repair_order__partner_invoice_id +msgid "Invoice Address" +msgstr "" + +#. module: repair_order_invoice_address +#: model:ir.model,name:repair_order_invoice_address.model_repair_order +msgid "Repair Order" +msgstr "Ordre de reparació" diff --git a/repair_order_invoice_address/i18n/en_GB.po b/repair_order_invoice_address/i18n/en_GB.po new file mode 100644 index 0000000..b56d3d2 --- /dev/null +++ b/repair_order_invoice_address/i18n/en_GB.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * repair_order_invoice_address +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-09-25 08:32+0000\n" +"PO-Revision-Date: 2024-09-25 08:32+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: repair_order_invoice_address +#: model:ir.model.fields,field_description:repair_order_invoice_address.field_repair_order__partner_invoice_id +msgid "Invoice Address" +msgstr "" + +#. module: repair_order_invoice_address +#: model:ir.model,name:repair_order_invoice_address.model_repair_order +msgid "Repair Order" +msgstr "" diff --git a/repair_order_invoice_address/i18n/es.po b/repair_order_invoice_address/i18n/es.po new file mode 100644 index 0000000..d0b39fc --- /dev/null +++ b/repair_order_invoice_address/i18n/es.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * repair_order_invoice_address +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-09-25 08:33+0000\n" +"PO-Revision-Date: 2024-09-25 08:33+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: repair_order_invoice_address +#: model:ir.model.fields,field_description:repair_order_invoice_address.field_repair_order__partner_invoice_id +msgid "Invoice Address" +msgstr "Dirección factura" + +#. module: repair_order_invoice_address +#: model:ir.model,name:repair_order_invoice_address.model_repair_order +msgid "Repair Order" +msgstr "Orden reparación" diff --git a/repair_order_invoice_address/i18n/fr.po b/repair_order_invoice_address/i18n/fr.po new file mode 100644 index 0000000..f6e7d25 --- /dev/null +++ b/repair_order_invoice_address/i18n/fr.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * repair_order_invoice_address +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-09-25 08:33+0000\n" +"PO-Revision-Date: 2024-09-25 08:33+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: repair_order_invoice_address +#: model:ir.model.fields,field_description:repair_order_invoice_address.field_repair_order__partner_invoice_id +msgid "Invoice Address" +msgstr "" + +#. module: repair_order_invoice_address +#: model:ir.model,name:repair_order_invoice_address.model_repair_order +msgid "Repair Order" +msgstr "Ordre de réparation" diff --git a/repair_order_invoice_address/i18n/repair_order_invoice_address.pot b/repair_order_invoice_address/i18n/repair_order_invoice_address.pot new file mode 100644 index 0000000..b56d3d2 --- /dev/null +++ b/repair_order_invoice_address/i18n/repair_order_invoice_address.pot @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * repair_order_invoice_address +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-09-25 08:32+0000\n" +"PO-Revision-Date: 2024-09-25 08:32+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: repair_order_invoice_address +#: model:ir.model.fields,field_description:repair_order_invoice_address.field_repair_order__partner_invoice_id +msgid "Invoice Address" +msgstr "" + +#. module: repair_order_invoice_address +#: model:ir.model,name:repair_order_invoice_address.model_repair_order +msgid "Repair Order" +msgstr "" diff --git a/repair_order_invoice_address/models/__init__.py b/repair_order_invoice_address/models/__init__.py new file mode 100644 index 0000000..2251f67 --- /dev/null +++ b/repair_order_invoice_address/models/__init__.py @@ -0,0 +1 @@ +from . import repair_order diff --git a/repair_order_invoice_address/models/repair_order.py b/repair_order_invoice_address/models/repair_order.py new file mode 100644 index 0000000..8d9b5ff --- /dev/null +++ b/repair_order_invoice_address/models/repair_order.py @@ -0,0 +1,27 @@ +# Copyright 2024 Alfredo de la Fuente - AvanzOSC +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html +from odoo import api, fields, models + + +class RepairOrder(models.Model): + _inherit = "repair.order" + + partner_invoice_id = fields.Many2one( + comodel_name="res.partner", + string="Invoice Address", + compute="_compute_partner_invoice_id", + store=True, + readonly=False, + required=False, + precompute=True, + domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", + ) + + @api.depends("partner_id") + def _compute_partner_invoice_id(self): + for repair in self: + repair.partner_invoice_id = ( + repair.partner_id.address_get(["invoice"])["invoice"] + if repair.partner_id + else False + ) diff --git a/repair_order_invoice_address/views/mrp_repair_view.xml b/repair_order_invoice_address/views/mrp_repair_view.xml new file mode 100644 index 0000000..0f897fe --- /dev/null +++ b/repair_order_invoice_address/views/mrp_repair_view.xml @@ -0,0 +1,25 @@ + + + + repair.order + + + + + + + + + + repair.order + + + + + + + + diff --git a/setup/repair_order_invoice_address/odoo/addons/repair_order_invoice_address b/setup/repair_order_invoice_address/odoo/addons/repair_order_invoice_address new file mode 120000 index 0000000..64360fb --- /dev/null +++ b/setup/repair_order_invoice_address/odoo/addons/repair_order_invoice_address @@ -0,0 +1 @@ +../../../../repair_order_invoice_address \ No newline at end of file diff --git a/setup/repair_order_invoice_address/setup.py b/setup/repair_order_invoice_address/setup.py new file mode 100644 index 0000000..28c57bb --- /dev/null +++ b/setup/repair_order_invoice_address/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)