forked from avanzosc/sale-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] sale_order_commercial_copy_false: copy = false in commercial fi…
…elds
- Loading branch information
1 parent
ca269fc
commit fb5d8b6
Showing
8 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <https://github.com/avanzosc/sale-addons/issues>`_. Please check there for existing issues or to report new ones. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Unai Beristain <[email protected]> | ||
|
||
* Ana Juaristi <[email protected]> | ||
|
||
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 <http://www.gnu.org/licenses/agpl-3.0-standalone.html>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import sale_order | ||
from . import sale_order_line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class SaleOrder(models.Model): | ||
_inherit = "sale.order" | ||
|
||
user_id = fields.Many2one( | ||
"res.users", | ||
copy=False, | ||
) |
10 changes: 10 additions & 0 deletions
10
sale_order_commercial_copy_false/models/sale_order_line.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
) |
1 change: 1 addition & 0 deletions
1
setup/sale_order_commercial_copy_false/odoo/addons/sale_order_commercial_copy_false
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../sale_order_commercial_copy_false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |