diff --git a/repair_order_lot_vehicle_customer/README.rst b/repair_order_lot_vehicle_customer/README.rst new file mode 100644 index 0000000..977ddf9 --- /dev/null +++ b/repair_order_lot_vehicle_customer/README.rst @@ -0,0 +1,30 @@ +.. 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 lot vehicle customer +================================= + +* In repairs when selecting the lot/chassis number, if that lot number is + associated with a vehicle and this one is associated with a customer, bring + the customer to the repair. + +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. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Contributors +------------ + +* Ana Juaristi +* Alfredo de la Fuente diff --git a/repair_order_lot_vehicle_customer/__init__.py b/repair_order_lot_vehicle_customer/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/repair_order_lot_vehicle_customer/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/repair_order_lot_vehicle_customer/__manifest__.py b/repair_order_lot_vehicle_customer/__manifest__.py new file mode 100644 index 0000000..fa57009 --- /dev/null +++ b/repair_order_lot_vehicle_customer/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2024 Alfredo de la Fuente - AvanzOSC +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Repair Order Lot Vehicle Customer", + "version": "14.0.1.0.0", + "category": "Inventory/Inventory", + "license": "AGPL-3", + "author": "Avanzosc", + "website": "https://github.com/avanzosc/mrp-repair-addons", + "depends": [ + "fleet", + "repair", + "stock_production_lot_fleet_vehicle", + ], + "data": [], + "installable": True, +} diff --git a/repair_order_lot_vehicle_customer/i18n/en_GB.po b/repair_order_lot_vehicle_customer/i18n/en_GB.po new file mode 100644 index 0000000..92c505b --- /dev/null +++ b/repair_order_lot_vehicle_customer/i18n/en_GB.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * repair_order_lot_vehicle_customer +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-25 06:41+0000\n" +"PO-Revision-Date: 2024-11-25 06:41+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_lot_vehicle_customer +#: model:ir.model.fields,field_description:repair_order_lot_vehicle_customer.field_repair_order__display_name +msgid "Display Name" +msgstr "" + +#. module: repair_order_lot_vehicle_customer +#: model:ir.model.fields,field_description:repair_order_lot_vehicle_customer.field_repair_order__id +msgid "ID" +msgstr "" + +#. module: repair_order_lot_vehicle_customer +#: model:ir.model.fields,field_description:repair_order_lot_vehicle_customer.field_repair_order____last_update +msgid "Last Modified on" +msgstr "" + +#. module: repair_order_lot_vehicle_customer +#: model:ir.model,name:repair_order_lot_vehicle_customer.model_repair_order +msgid "Repair Order" +msgstr "" diff --git a/repair_order_lot_vehicle_customer/i18n/es.po b/repair_order_lot_vehicle_customer/i18n/es.po new file mode 100644 index 0000000..99a2d77 --- /dev/null +++ b/repair_order_lot_vehicle_customer/i18n/es.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * repair_order_lot_vehicle_customer +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-25 06:41+0000\n" +"PO-Revision-Date: 2024-11-25 06:41+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_lot_vehicle_customer +#: model:ir.model.fields,field_description:repair_order_lot_vehicle_customer.field_repair_order__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: repair_order_lot_vehicle_customer +#: model:ir.model.fields,field_description:repair_order_lot_vehicle_customer.field_repair_order__id +msgid "ID" +msgstr "ID" + +#. module: repair_order_lot_vehicle_customer +#: model:ir.model.fields,field_description:repair_order_lot_vehicle_customer.field_repair_order____last_update +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: repair_order_lot_vehicle_customer +#: model:ir.model,name:repair_order_lot_vehicle_customer.model_repair_order +msgid "Repair Order" +msgstr "Orden de reparación" diff --git a/repair_order_lot_vehicle_customer/i18n/repair_order_lot_vehicle_customer.pot b/repair_order_lot_vehicle_customer/i18n/repair_order_lot_vehicle_customer.pot new file mode 100644 index 0000000..fa730e0 --- /dev/null +++ b/repair_order_lot_vehicle_customer/i18n/repair_order_lot_vehicle_customer.pot @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * repair_order_lot_vehicle_customer +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-11-25 06:40+0000\n" +"PO-Revision-Date: 2024-11-25 06:40+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_lot_vehicle_customer +#: model:ir.model.fields,field_description:repair_order_lot_vehicle_customer.field_repair_order__display_name +msgid "Display Name" +msgstr "" + +#. module: repair_order_lot_vehicle_customer +#: model:ir.model.fields,field_description:repair_order_lot_vehicle_customer.field_repair_order__id +msgid "ID" +msgstr "" + +#. module: repair_order_lot_vehicle_customer +#: model:ir.model.fields,field_description:repair_order_lot_vehicle_customer.field_repair_order____last_update +msgid "Last Modified on" +msgstr "" + +#. module: repair_order_lot_vehicle_customer +#: model:ir.model,name:repair_order_lot_vehicle_customer.model_repair_order +msgid "Repair Order" +msgstr "" diff --git a/repair_order_lot_vehicle_customer/models/__init__.py b/repair_order_lot_vehicle_customer/models/__init__.py new file mode 100644 index 0000000..2251f67 --- /dev/null +++ b/repair_order_lot_vehicle_customer/models/__init__.py @@ -0,0 +1 @@ +from . import repair_order diff --git a/repair_order_lot_vehicle_customer/models/repair_order.py b/repair_order_lot_vehicle_customer/models/repair_order.py new file mode 100644 index 0000000..6541f32 --- /dev/null +++ b/repair_order_lot_vehicle_customer/models/repair_order.py @@ -0,0 +1,13 @@ +# Copyright 2024 Alfredo de la Fuente - AvanzOSC +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, models + + +class RepairOrder(models.Model): + _inherit = "repair.order" + + @api.onchange("lot_id") + def _onchange_lot_id(self): + if self.lot_id and self.lot_id.vehicle_id and self.lot_id.vehicle_id.driver_id: + self.partner_id = self.lot_id.vehicle_id.driver_id.id diff --git a/setup/repair_order_lot_vehicle_customer/odoo/addons/repair_order_lot_vehicle_customer b/setup/repair_order_lot_vehicle_customer/odoo/addons/repair_order_lot_vehicle_customer new file mode 120000 index 0000000..d3f3a65 --- /dev/null +++ b/setup/repair_order_lot_vehicle_customer/odoo/addons/repair_order_lot_vehicle_customer @@ -0,0 +1 @@ +../../../../repair_order_lot_vehicle_customer \ No newline at end of file diff --git a/setup/repair_order_lot_vehicle_customer/setup.py b/setup/repair_order_lot_vehicle_customer/setup.py new file mode 100644 index 0000000..28c57bb --- /dev/null +++ b/setup/repair_order_lot_vehicle_customer/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)