Skip to content

Commit

Permalink
[ADD] module sale_edit_price_wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-champonnois committed Jun 9, 2022
1 parent 9ae89b5 commit b9eb927
Show file tree
Hide file tree
Showing 20 changed files with 654 additions and 56 deletions.
1 change: 1 addition & 0 deletions beesdoo_product/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"purchase",
"product_main_supplier",
"sale_suggested_price",
"sale_edit_price_wizard",
],
"data": [
"data/product_label.xml",
Expand Down
4 changes: 1 addition & 3 deletions product_main_supplier/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
"product",
],
"excludes": [],
"data": [
"views/product_template_views.xml",
],
"data": [],
"demo": [],
"qweb": [],
}
22 changes: 0 additions & 22 deletions product_main_supplier/views/product_template_views.xml

This file was deleted.

83 changes: 83 additions & 0 deletions sale_edit_price_wizard/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
====================
sale_suggested_price
====================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-coopiteasy%2Fobeesdoo-lightgray.png?logo=github
:target: https://github.com/coopiteasy/obeesdoo/tree/12.0/sale_suggested_price
:alt: coopiteasy/obeesdoo

|badge1| |badge2| |badge3|

- Add a 'Suggested Price' field on products, and a 'Product Margin' field on Partners (Vendors) and Product Categories.
The first margin is used if set, otherwise the second margin (which has a default value) is used.
- The reference price on which this margin is applied (supplier price or sale price)
can be selected in the general settings.
- Also, sale and supplier taxes that are of type 'percentage' and that are marked as 'included in price'
are taken into account when computing the suggested price.
- Round suggested price to 5 cents
- Adds "Edit Price" submenu on Point Of Sale, Purchase and Sale modules.
The user lands on an editable List View with the following columns :

- Name (`name`)
- Main Seller (`main_seller_id`)
- Purchase Price (`purchase_price`)
- Purchase Unit of Measure (`uom_po_id`)
- Suggested Price (`suggested_price`)
- Sales Price (`list_price`)
- Unit of Measure (`uom_id`)

The only editable field is Purchase Price.
Through "Action > Adapt Sales Price", the user can, on the selected products,
adapt the Sales Price according to the Suggested Price.

Please note that this model makes assumptions when computing the suggested price:

- It supposes that each product has only one supplier and that products coming from multiple suppliers
occur as duplicated products with one supplier each.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/coopiteasy/obeesdoo/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/coopiteasy/obeesdoo/issues/new?body=module:%20sale_suggested_price%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Coop IT Easy SCRLfs

Contributors
~~~~~~~~~~~~

* Beescoop - Cellule IT
* `Coop IT Easy SCRLfs <https://coopiteasy.be>`_:

Maintainers
~~~~~~~~~~~

This module is part of the `coopiteasy/obeesdoo <https://github.com/coopiteasy/obeesdoo/tree/12.0/sale_suggested_price>`_ project on GitHub.

You are welcome to contribute.
45 changes: 45 additions & 0 deletions sale_edit_price_wizard/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from . import wizard

from odoo import api, SUPERUSER_ID
from openupgradelib import openupgrade


renamed_view_xml_ids = (
(
"beesdoo_product.purchase_product_edit_price",
"sale_edit_price_wizard.purchase_product_edit_price",
),
(
"beesdoo_product.menu_purchase_edit_price",
"sale_edit_price_wizard.menu_purchase_edit_price",
),
(
"beesdoo_product.sale_product_edit_price",
"sale_edit_price_wizard.sale_product_edit_price",
),
(
"beesdoo_product.menu_sale_edit_price",
"sale_edit_price_wizard.menu_sale_edit_price",
),
(
"beesdoo_product.purchase_product_edit_price",
"sale_edit_price_wizard.purchase_product_edit_price",
),
(
"beesdoo_product.purchase_product_edit_price",
"sale_edit_price_wizard.purchase_product_edit_price",
),
(
"beesdoo_product.product_template_edit_price_tree_view",
"sale_edit_price_wizard.product_template_edit_price_tree_view",
),
(
"beesdoo_product.adapt_sales_price_wizard",
"sale_edit_price_wizard.adapt_sales_price_wizard",
),
)


def rename_xml_ids(cr):
env = api.Environment(cr, SUPERUSER_ID, {})
openupgrade.rename_xmlids(env.cr, renamed_view_xml_ids)
34 changes: 34 additions & 0 deletions sale_edit_price_wizard/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2022 Coop IT Easy SCRLfs
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Edit Price Wizard",
"summary": """
Add "Edit Price" submenu on Point Of Sale, Purchase and Sale modules.""",
"version": "12.0.1.0.0",
"category": "Sales",
"website": "https://github.com/beescoop/Obeesdoo",
"author": "Coop IT Easy SCRLfs",
"license": "AGPL-3",
"application": False,
"depends": [
"product",
"purchase",
"sale",
"sale_suggested_price",
"product_main_supplier",
],
"external_dependencies": {
"python": ["openupgradelib"],
},
"excludes": [],
"data": [
"views/product_template_views.xml",
"views/purchase_views.xml",
"views/sale_views.xml",
"wizard/views/adapt_sales_price_wizard_view.xml",
],
"demo": [],
"qweb": [],
"pre_init_hook": "rename_xml_ids",
}
2 changes: 2 additions & 0 deletions sale_edit_price_wizard/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Beescoop - Cellule IT
* `Coop IT Easy SCRLfs <https://coopiteasy.be>`_:
2 changes: 2 additions & 0 deletions sale_edit_price_wizard/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Add "Edit Price" submenu on Point Of Sale, Purchase and Sale modules.
- Add a wizard to automatically adapt the price to the suggested price.
Loading

0 comments on commit b9eb927

Please sign in to comment.