diff --git a/sale_order_commercial_copy_false/README.rst b/sale_order_commercial_copy_false/README.rst new file mode 100644 index 00000000..bb78b47b --- /dev/null +++ b/sale_order_commercial_copy_false/README.rst @@ -0,0 +1,75 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +================================ +Sale Order Commercial Copy False +================================ + +Overview +======== + +The **Sale Order Commercial Copy False** module modifies the behavior of duplicate sale orders by ensuring that certain fields related to the commercial partner are not copied to the new order. This helps maintain data integrity and avoids unnecessary duplication of sensitive information. + +Features +======== + +- **Sale Order**: + + - The `user_id` field is not copied when duplicating a sale order. + +- **Sale Order Line**: + + - The `salesman_id` field is not copied when duplicating a sale order line. + +Usage +===== + +After installing the module, the following changes will be applied: + +- **Sale Orders**: + + - When duplicating a sale order, the `user_id` field will not be copied to the new order. + +- **Sale Order Lines**: + + - When duplicating a sale order line, the `salesman_id` field will not be copied to the new line. + +Configuration +============= + +No additional configuration is required. The module works out of the box once installed. + +Testing +======= + +The module has been designed with the following functionalities in mind: + +- **Duplication of Sale Orders**: + + - Test the duplication of sale orders to ensure that the `user_id` field is not copied to the new order. + +- **Duplication of Sale Order Lines**: + + - Test the duplication of sale order lines to ensure that the `salesman_id` field is not copied to the new line. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. Please check there for existing issues or to report new ones. + +Credits +======= + +Contributors +------------ + +* Unai Beristain + +* Ana Juaristi + +Do not contact contributors directly about support or help with technical issues. + +License +======= +This project is licensed under the AGPL-3 License. For more details, please refer to the LICENSE file or visit . diff --git a/sale_order_commercial_copy_false/__init__.py b/sale_order_commercial_copy_false/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/sale_order_commercial_copy_false/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_order_commercial_copy_false/__manifest__.py b/sale_order_commercial_copy_false/__manifest__.py new file mode 100644 index 00000000..3d18b888 --- /dev/null +++ b/sale_order_commercial_copy_false/__manifest__.py @@ -0,0 +1,13 @@ +{ + "name": "Sale Order Commercial Copy False", + "version": "14.0.1.0.0", + "category": "Sales", + "summary": "Make commercial partner ID fields not copied on sale order duplicate", + "author": "Avanzosc", + "website": "https://github.com/avanzosc/sale-addons", + "license": "AGPL-3", + "depends": ["sale"], + "data": [], + "installable": True, + "application": False, +} diff --git a/sale_order_commercial_copy_false/models/__init__.py b/sale_order_commercial_copy_false/models/__init__.py new file mode 100644 index 00000000..2d7ee6c3 --- /dev/null +++ b/sale_order_commercial_copy_false/models/__init__.py @@ -0,0 +1,2 @@ +from . import sale_order +from . import sale_order_line diff --git a/sale_order_commercial_copy_false/models/sale_order.py b/sale_order_commercial_copy_false/models/sale_order.py new file mode 100644 index 00000000..d0ede718 --- /dev/null +++ b/sale_order_commercial_copy_false/models/sale_order.py @@ -0,0 +1,10 @@ +from odoo import fields, models + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + user_id = fields.Many2one( + "res.users", + copy=False, + ) diff --git a/sale_order_commercial_copy_false/models/sale_order_line.py b/sale_order_commercial_copy_false/models/sale_order_line.py new file mode 100644 index 00000000..6d4e338e --- /dev/null +++ b/sale_order_commercial_copy_false/models/sale_order_line.py @@ -0,0 +1,10 @@ +from odoo import fields, models + + +class SaleOrderLine(models.Model): + _inherit = "sale.order.line" + + salesman_id = fields.Many2one( + "res.users", + copy=False, + ) diff --git a/setup/sale_order_commercial_copy_false/odoo/addons/sale_order_commercial_copy_false b/setup/sale_order_commercial_copy_false/odoo/addons/sale_order_commercial_copy_false new file mode 120000 index 00000000..afa610f5 --- /dev/null +++ b/setup/sale_order_commercial_copy_false/odoo/addons/sale_order_commercial_copy_false @@ -0,0 +1 @@ +../../../../sale_order_commercial_copy_false \ No newline at end of file diff --git a/setup/sale_order_commercial_copy_false/setup.py b/setup/sale_order_commercial_copy_false/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/sale_order_commercial_copy_false/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)