diff --git a/repair_order_default_location/README.rst b/repair_order_default_location/README.rst new file mode 100644 index 000000000..80998a5d9 --- /dev/null +++ b/repair_order_default_location/README.rst @@ -0,0 +1,64 @@ +============================= +Repair Order default Location +============================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:26a6d3345bb642785c9636c885734207c0749ea29d7b2eac84317a92cf7a6d32 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-NuoBiT%2Fodoo--addons-lightgray.png?logo=github + :target: https://github.com/NuoBiT/odoo-addons/tree/18.0/repair_order_default_location + :alt: NuoBiT/odoo-addons + +|badge1| |badge2| |badge3| + +This module uses the header location as a default for the new components +line + +**Table of contents** + +.. contents:: + :local: + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* NuoBiT Solutions SL + +Contributors +------------ + +- `NoBiT `__: + + - Eric Antones eantones@nuobit.com + - Deniz Gallo dgallo@nuobit.com + +Maintainers +----------- + +This module is part of the `NuoBiT/odoo-addons `_ project on GitHub. + +You are welcome to contribute. diff --git a/repair_order_default_location/__init__.py b/repair_order_default_location/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/repair_order_default_location/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/repair_order_default_location/__manifest__.py b/repair_order_default_location/__manifest__.py new file mode 100644 index 000000000..ec35674d8 --- /dev/null +++ b/repair_order_default_location/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright NuoBiT Solutions SL - Antones +# Copyright 2025 NuoBiT Solutions SL - Deniz Gallo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +{ + "name": "Repair Order default Location", + "summary": "This module uses the header location " + "as a default for the new components line", + "version": "18.0.1.0.0", + "author": "NuoBiT Solutions SL", + "website": "https://github.com/NuoBiT/odoo-addons", + "category": "Repair", + "license": "AGPL-3", + "depends": [ + "repair", + ], +} diff --git a/repair_order_default_location/models/__init__.py b/repair_order_default_location/models/__init__.py new file mode 100644 index 000000000..6bda2d242 --- /dev/null +++ b/repair_order_default_location/models/__init__.py @@ -0,0 +1 @@ +from . import stock_move diff --git a/repair_order_default_location/models/stock_move.py b/repair_order_default_location/models/stock_move.py new file mode 100644 index 000000000..1bb3a7561 --- /dev/null +++ b/repair_order_default_location/models/stock_move.py @@ -0,0 +1,28 @@ +# Copyright NuoBiT Solutions SL - Antones +# Copyright 2025 NuoBiT Solutions SL - Deniz Gallo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +from odoo import api, models + + +class RepairLine(models.Model): + _inherit = "stock.move" + + @api.onchange("repair_line_type") + def onchange_operation_type(self): + if ( + self.repair_line_type == "add" + and self.move_lines_count == 0 + and self.product_id + ): + self.move_line_ids = [ + ( + 0, + 0, + { + "product_id": self.product_id.id, + "location_id": self.repair_id.location_id.id, + "quantity": self.product_uom_qty, + }, + ) + ] diff --git a/repair_order_default_location/pyproject.toml b/repair_order_default_location/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/repair_order_default_location/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/repair_order_default_location/readme/CONTRIBUTORS.md b/repair_order_default_location/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..e30059da3 --- /dev/null +++ b/repair_order_default_location/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [NoBiT](https://www.nuobi.com): + - Eric Antones + - Deniz Gallo diff --git a/repair_order_default_location/readme/DESCRIPTION.md b/repair_order_default_location/readme/DESCRIPTION.md new file mode 100644 index 000000000..449643c31 --- /dev/null +++ b/repair_order_default_location/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module uses the header location as a default for the new components +line diff --git a/repair_order_default_location/static/description/icon.png b/repair_order_default_location/static/description/icon.png new file mode 100644 index 000000000..1cd641e79 Binary files /dev/null and b/repair_order_default_location/static/description/icon.png differ diff --git a/repair_order_default_location/static/description/index.html b/repair_order_default_location/static/description/index.html new file mode 100644 index 000000000..70c575189 --- /dev/null +++ b/repair_order_default_location/static/description/index.html @@ -0,0 +1,421 @@ + + + + + +Repair Order default Location + + + +
+

Repair Order default Location

+ + +

Beta License: AGPL-3 NuoBiT/odoo-addons

+

This module uses the header location as a default for the new components +line

+

Table of contents

+ +
+

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 to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • NuoBiT Solutions SL
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the NuoBiT/odoo-addons project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/setup/repair_order_default_location/odoo/addons/repair_order_default_location b/setup/repair_order_default_location/odoo/addons/repair_order_default_location new file mode 120000 index 000000000..191c10f42 --- /dev/null +++ b/setup/repair_order_default_location/odoo/addons/repair_order_default_location @@ -0,0 +1 @@ +../../../../repair_order_default_location \ No newline at end of file diff --git a/setup/repair_order_default_location/setup.py b/setup/repair_order_default_location/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/repair_order_default_location/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)