diff --git a/.copier-answers.yml b/.copier-answers.yml index b63e2b9bb27..0f487037a72 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.30 +_commit: v1.33 _src_path: gh:oca/oca-addons-repo-template ci: GitHub convert_readme_fragments_to_markdown: false @@ -20,6 +20,7 @@ rebel_module_groups: - sale_packaging_default,sale_order_product_recommendation,sale_order_product_recommendation_packaging_default,sale_order_product_recommendation_elaboration - sale_order_general_discount_triple,sale_pricelist_triple_discount,sale_triple_discount - sale_fixed_discount +- sale_order_safe_commitment_date repo_description: 'TODO: add repo description.' repo_name: sale-workflow repo_slug: sale-workflow diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55a2f04695f..eebf6021edc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,10 +57,17 @@ jobs: name: test with OCB makepot: "true" - container: ghcr.io/oca/oca-ci/py3.10-odoo16.0:latest - exclude: "sale_packaging_default,sale_order_product_recommendation,sale_order_product_recommendation_packaging_default,sale_order_product_recommendation_elaboration,sale_order_general_discount_triple,sale_pricelist_triple_discount,sale_triple_discount,sale_fixed_discount" + include: "sale_order_safe_commitment_date" name: test with Odoo - container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest - exclude: "sale_packaging_default,sale_order_product_recommendation,sale_order_product_recommendation_packaging_default,sale_order_product_recommendation_elaboration,sale_order_general_discount_triple,sale_pricelist_triple_discount,sale_triple_discount,sale_fixed_discount" + include: "sale_order_safe_commitment_date" + name: test with OCB + makepot: "true" + - container: ghcr.io/oca/oca-ci/py3.10-odoo16.0:latest + exclude: "sale_packaging_default,sale_order_product_recommendation,sale_order_product_recommendation_packaging_default,sale_order_product_recommendation_elaboration,sale_order_general_discount_triple,sale_pricelist_triple_discount,sale_triple_discount,sale_fixed_discount,sale_order_safe_commitment_date" + name: test with Odoo + - container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest + exclude: "sale_packaging_default,sale_order_product_recommendation,sale_order_product_recommendation_packaging_default,sale_order_product_recommendation_elaboration,sale_order_general_discount_triple,sale_pricelist_triple_discount,sale_triple_discount,sale_fixed_discount,sale_order_safe_commitment_date" name: test with OCB makepot: "true" services: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f8452af4cf..e855f37e74f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: language: fail files: '[a-zA-Z0-9_]*/i18n/en\.po$' - repo: https://github.com/oca/maintainer-tools - rev: d5fab7ee87fceee858a3d01048c78a548974d935 + rev: f9b919b9868143135a9c9cb03021089cabba8223 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons diff --git a/sale_order_line_no_print/README.rst b/sale_order_line_no_print/README.rst new file mode 100644 index 00000000000..0c2de50ec1a --- /dev/null +++ b/sale_order_line_no_print/README.rst @@ -0,0 +1,117 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +================================ +Sale order line hidden in report +================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:a03ee690d8ef56078c0373a096d2e5494611e4ea80869c08c66dae8d266c24ca + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/sale-workflow/tree/16.0/sale_order_line_no_print + :alt: OCA/sale-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_order_line_no_print + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to hide some order lines from the reports and portal +views that the final customer has access to. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Use Cases / Context +=================== + +In some ocassions the salesman wants to hide some info that's no +relevant for the customer but that it's needed for other documents +(delivery info, pack items, etc.) as they don't want to disclose some +strategic data to the competence. + +Usage +===== + +To hide sale lines from the report: + +- Go to a sales order/quotation/invoice. +- In the lines, click on the column selector to reveal the *Display in + report* column. +- Toggle it on or off depending on your will. +- Go to the portal view: you won't see those hidden lines. + +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 +------- + +* Moduon + +Contributors +------------ + +- David Vidal (`Moduon `__) +- Jairo Llopis (`Moduon `__) + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-chienandalu| image:: https://github.com/chienandalu.png?size=40px + :target: https://github.com/chienandalu + :alt: chienandalu +.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px + :target: https://github.com/rafaelbn + :alt: rafaelbn + +Current `maintainers `__: + +|maintainer-chienandalu| |maintainer-rafaelbn| + +This module is part of the `OCA/sale-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_order_line_no_print/static/description/index.html b/sale_order_line_no_print/static/description/index.html new file mode 100644 index 00000000000..d1ecf673c59 --- /dev/null +++ b/sale_order_line_no_print/static/description/index.html @@ -0,0 +1,459 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Sale order line hidden in report

+ +

Alpha License: LGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runboat

+

This module allows to hide some order lines from the reports and portal +views that the final customer has access to.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Use Cases / Context

+

In some ocassions the salesman wants to hide some info that’s no +relevant for the customer but that it’s needed for other documents +(delivery info, pack items, etc.) as they don’t want to disclose some +strategic data to the competence.

+
+
+

Usage

+

To hide sale lines from the report:

+
    +
  • Go to a sales order/quotation/invoice.
  • +
  • In the lines, click on the column selector to reveal the Display in +report column.
  • +
  • Toggle it on or off depending on your will.
  • +
  • Go to the portal view: you won’t see those hidden lines.
  • +
+
+
+

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

+
    +
  • Moduon
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainers:

+

chienandalu rafaelbn

+

This module is part of the OCA/sale-workflow project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/sale_order_line_price_lock_by_pricelist/README.rst b/sale_order_line_price_lock_by_pricelist/README.rst new file mode 100644 index 00000000000..b5d1442e2bf --- /dev/null +++ b/sale_order_line_price_lock_by_pricelist/README.rst @@ -0,0 +1,140 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============================== +Sale line locking by pricelist +============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:972b861f22f5d8c61eeef9e2a4e56e202cfd1b06b1d6a2d60a276d98deaef9b3 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/sale-workflow/tree/16.0/sale_order_line_price_lock_by_pricelist + :alt: OCA/sale-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_order_line_price_lock_by_pricelist + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to lock price edition based on the applied pricelist +rule scope. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Use Cases / Context +=================== + +Sometimes we want to avoid that salesmen are able to modify prices that +are fixed and negociated with the customer in advance. + +Configuration +============= + +In order to configure the prices lock scope, go to the pricelist you +want to configure or create a new one from *Sales > Products > +Pricelists*. + +Now, in the *Configuration* tab, you can set the scope on the field +\*\ *Lock product prices applied on*. The possible options are: + +- All products: any rule will lock the price. Very restrictive. +- Product category: all the rules applied on product category, product + or variants will lock the price. +- Product: all the rules applied on product or variants will lock the + price. +- Product variant: only the rules applied on variants will lock the + price. + +For this example, we'll choose the *Product* scope. + +Then, in the price rules, we'll add a fixed price of 80 to be applied on +the product *FURN_5555*. Save and close and go to the **Usage** section +to test it in the sales order. + +Usage +===== + +To use this module, you need to log in as a salesman (i.e.: demo user), +as sales manager won't be locked. Then: + +1. Create a new sales order. +2. Chose the pricelist we configured before. +3. Add the product FURN_5555: you'll see that the price unit is locked. +4. Add another product: the price unit can be edited for that line. +5. Change the pricelist: now you can edit the price for FURN_5555 again. + +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 +------- + +* Moduon + +Contributors +------------ + +- Rafael Blasco (`Moduon `__) +- David Vidal (`Moduon `__) + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-chienandalu| image:: https://github.com/chienandalu.png?size=40px + :target: https://github.com/chienandalu + :alt: chienandalu +.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px + :target: https://github.com/rafaelbn + :alt: rafaelbn + +Current `maintainers `__: + +|maintainer-chienandalu| |maintainer-rafaelbn| + +This module is part of the `OCA/sale-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_order_line_price_lock_by_pricelist/static/description/index.html b/sale_order_line_price_lock_by_pricelist/static/description/index.html new file mode 100644 index 00000000000..726a079bc4c --- /dev/null +++ b/sale_order_line_price_lock_by_pricelist/static/description/index.html @@ -0,0 +1,480 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Sale line locking by pricelist

+ +

Alpha License: LGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runboat

+

This module allows to lock price edition based on the applied pricelist +rule scope.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Use Cases / Context

+

Sometimes we want to avoid that salesmen are able to modify prices that +are fixed and negociated with the customer in advance.

+
+
+

Configuration

+

In order to configure the prices lock scope, go to the pricelist you +want to configure or create a new one from Sales > Products > +Pricelists.

+

Now, in the Configuration tab, you can set the scope on the field +*Lock product prices applied on. The possible options are:

+
    +
  • All products: any rule will lock the price. Very restrictive.
  • +
  • Product category: all the rules applied on product category, product +or variants will lock the price.
  • +
  • Product: all the rules applied on product or variants will lock the +price.
  • +
  • Product variant: only the rules applied on variants will lock the +price.
  • +
+

For this example, we’ll choose the Product scope.

+

Then, in the price rules, we’ll add a fixed price of 80 to be applied on +the product FURN_5555. Save and close and go to the Usage section +to test it in the sales order.

+
+
+

Usage

+

To use this module, you need to log in as a salesman (i.e.: demo user), +as sales manager won’t be locked. Then:

+
    +
  1. Create a new sales order.
  2. +
  3. Chose the pricelist we configured before.
  4. +
  5. Add the product FURN_5555: you’ll see that the price unit is locked.
  6. +
  7. Add another product: the price unit can be edited for that line.
  8. +
  9. Change the pricelist: now you can edit the price for FURN_5555 again.
  10. +
+
+
+

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

+
    +
  • Moduon
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainers:

+

chienandalu rafaelbn

+

This module is part of the OCA/sale-workflow project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/sale_order_safe_commitment_date/models/sale_order.py b/sale_order_safe_commitment_date/models/sale_order.py index ea91c6cd406..b476c9b71ef 100644 --- a/sale_order_safe_commitment_date/models/sale_order.py +++ b/sale_order_safe_commitment_date/models/sale_order.py @@ -6,10 +6,22 @@ class SaleOrder(models.Model): _inherit = "sale.order" + commitment_date = fields.Datetime( + compute="_compute_commitment_date", + store=True, + readonly=False, + ) is_commitment_date_unsafe = fields.Boolean( compute="_compute_is_commitment_date_unsafe", ) + @api.depends("expected_date") + def _compute_commitment_date(self): + for sale in self.filtered( + lambda x: x.expected_date and x.state in ["draft", "sent"] + ): + sale.commitment_date = sale.expected_date + @api.depends("commitment_date", "expected_date", "state") def _compute_is_commitment_date_unsafe(self): """A commitment date is considered unsafe if it is before the expected date as