Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][17.0] [MIG]product_configurator_sale #112

Open
wants to merge 76 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
55865db
seperate sale order form wizard module added new sale module for same…
May 20, 2017
4cd75e3
added condition for the model checking
May 20, 2017
6be5f5a
remove _wizard module and added defualt wizard to base module, creati…
May 22, 2017
3d628ac
Small fixes & flake8
May 24, 2017
8f38544
General fixes and flake8
PCatinean May 25, 2017
4874cd0
Overriding product search to prevent configurable products usage in s…
PCatinean May 25, 2017
4bbeb81
Moved extra_lines_values to so wizard
PCatinean May 26, 2017
b59680e
Added subconfigurable products to configuration wizard
PCatinean Jun 11, 2017
5cf107c
General fixes and improvements
PCatinean Jun 26, 2017
2ea1a0f
Removed console.log, renamed __openerp__.py files to __manifest__.py
PCatinean Feb 20, 2018
7d69093
Bumped version to 11.0 and removed all traces of coding: utf-8 from p…
PCatinean May 14, 2018
72e153d
Kept application only for base and website + fixed _get_price_extra
PCatinean May 14, 2018
e052a9f
Using no-save deepcopy of event to replicate same functionality, adde…
PCatinean May 15, 2018
03cb64d
product_configurator_sale, product_configurator_purchase : add config…
bizzappdev Sep 11, 2018
2c33f96
Revert "[FIX][T1902]product_configurator_sale, product_configurator_p…
bizzappdev Sep 11, 2018
12eabd4
product_configurator_sale, product_configurator_purchase : add config…
bizzappdev Sep 11, 2018
cacefa8
fix flake8 error
bizzappdev Sep 11, 2018
9384042
product_configurator_sale, product_configurator_purchase : add class …
bizzappdev Sep 24, 2018
4a92c52
product_configurator,product_configurator_purchase,product_configurat…
bizzappdev Sep 25, 2018
1e805c8
product_configurator,product_configurator_purchase,product_cnofigurat…
bizzappdev Sep 25, 2018
786152c
product_configurator,product_configurator_sale,product_configurator_p…
bizzappdev Sep 25, 2018
9c0346d
fix flake8 error
bizzappdev Sep 25, 2018
ae42032
product_configurator : fix typing error, change method name, set clic…
bizzappdev Sep 25, 2018
3a1a7ab
Working version of sales_mrp glue module, no tests
PCatinean Sep 26, 2018
1b4d52e
Added context values to reconfigure method to fix reset missing values
PCatinean Sep 27, 2018
22251c7
product_configurator_sale : remove extra view
bizzappdev Sep 27, 2018
839840a
product_configurator_sale : add space
bizzappdev Sep 28, 2018
36e0f75
Added module description & removing invisible attribute of attr val l…
PCatinean Oct 19, 2018
78ede83
Using onchange to get values for new/edited sale order lines
PCatinean Feb 1, 2019
238e4d4
Updating initial line vals with missing fields dicts
PCatinean Feb 4, 2019
c853342
product_configurator_sale: call onchange after creating or writing on…
bizzappdev Apr 9, 2019
193bc0b
use onchange() instead of calling all onchane methods explicitly
bizzappdev Apr 9, 2019
d8bad8d
website_product_configurator:solved flake8 and pylints
May 27, 2019
d4004ab
product_configurator:improve the code and write test case for inverse…
Jun 6, 2019
d6ef0df
product_configurator:improve the code and write test case for inverse…
Jun 6, 2019
d283473
fix action_config_done in other modules, now check for incomplete step
bizzappdev Jun 6, 2019
fa1aa72
product_configurator_sale, product_configurator, product_configurator…
Jun 7, 2019
babb233
product_configurator: add new changes and fix some issue
bizzappdev Jun 19, 2019
f4a06ed
product_configurator: add changes for test-case
bizzappdev Jun 24, 2019
8630123
product_configurator: add changes for test-case
bizzappdev Jun 24, 2019
78ead54
fix default filter,add desciption, allow to keep value_id in attrline…
bizzappdev Jun 26, 2019
814d8c0
add onchange and remove related
bizzappdev Jun 26, 2019
66cf8f2
remove onchange and add readonly in config_ok on sol/pol/ml
bizzappdev Jun 27, 2019
d467542
product_configurator : write testcase
Jun 28, 2019
a7482ea
fix issue test-case issue in product_configurator_sale,stock,purchase
bizzappdev Jun 29, 2019
adb0581
demo file remove dealer and land field
bizzappdev Jun 29, 2019
a8b505b
fix pylint error
bizzappdev Jul 2, 2019
93b6540
change version in manifest file
bizzappdev Jul 26, 2019
1b8497e
Add installable False to module from version 12
bizzappdev Dec 26, 2019
94bb161
migrate product_configurator_sale to v13 from v12
bizzappdev Jan 2, 2020
c28e574
set sol name from meko template
bizzappdev Jan 2, 2020
f316851
use helper methods to call onchage
bizzappdev Jan 4, 2020
ef0ca15
make custom_value_ids related to config session instead of variant
bizzappdev Jan 4, 2020
d2c0683
fix field name custom_value_ids
bizzappdev Jan 6, 2020
b344a8f
fix comodel_name in name custom_value_ids
bizzappdev Jan 6, 2020
6ff7362
fix flake8
bizzappdev Jan 28, 2020
988c581
fix custom value ids
bizzappdev Nov 4, 2020
c71bf17
pre-commit
Chandresh-SerpentCS Apr 1, 2021
2ffb9ca
Modified the code as per v14.
Chandresh-OSI Apr 7, 2021
28b7e62
product_configurator_sale: add OCA readme
dreispt Apr 27, 2021
d1afdca
product_configurator_sale: fix log warnings on install
dreispt May 4, 2021
2021107
Add pcatinean as maintainer for all modules
PCatinean Jun 15, 2021
6747732
product_configurator_sale: avoid other module inheritance issues
dreispt Sep 23, 2021
0d5defe
product_configurator_sale (Add customer lead)
patrickrwilson Oct 19, 2021
8337175
product_configurator: remove price calculation from session and also …
pledrateam Oct 25, 2021
33a95b2
*: fix PCatinean maintainer
dreispt Dec 10, 2021
d952136
product_configurator_sale (Custom Values on Reconfigure)
patrickrwilson Feb 8, 2022
aecf54a
Fix context erasement
BenjaHe Apr 25, 2023
97dd4d4
product_configurator_sale: Migration to 16.0
dannyadair Jun 11, 2023
b0bdb12
product_configurator_sale: Compute price of all lines Also there is n…
SirAionTech Jan 11, 2024
7db05d8
product_configurator_sale: Version
SirAionTech Jan 11, 2024
9d0dc49
product_configurator_sale: Missing dependency Otherwise the following…
SirAionTech Jan 11, 2024
db5132e
product_configurator_sale: Show custom values in sale line
SirAionTech Jan 18, 2024
b5d9c31
[MIG] product_configurator_sale: Migrated in v17
Chirag-OSI Feb 20, 2024
0fda558
[FIX] removed unused fields.
Chirag-OSI Mar 6, 2024
42008e4
[IMP]ADD Sales Team User CSV.
Vandan-OSI Aug 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions product_configurator_sale/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Product Configurator Sale
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--configurator-lightgray.png?logo=github
:target: https://github.com/OCA/product-configurator/tree/14.0/product_configurator_sale
:target: https://github.com/OCA/product-configurator/tree/17.0/product_configurator_sale
:alt: OCA/product-configurator
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/product-configurator-14-0/product-configurator-14-0-product_configurator_sale
:target: https://translation.odoo-community.org/projects/product-configurator-17-0/product-configurator-17-0-product_configurator_sale
: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/product-configurator&target_branch=14.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-configurator&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -41,20 +41,20 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-configurator/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 <https://github.com/OCA/product-configurator/issues/new?body=module:%20product_configurator_sale%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/product-configurator/issues/new?body=module:%20product_configurator_sale%0Aversion:%2017.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
~~~~~~~
-------

* Pledra

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -74,6 +74,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-PCatinean|

This module is part of the `OCA/product-configurator <https://github.com/OCA/product-configurator/tree/14.0/product_configurator_sale>`_ project on GitHub.
This module is part of the `OCA/product-configurator <https://github.com/OCA/product-configurator/tree/17.0/product_configurator_sale>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion product_configurator_sale/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Product Configurator Sale",
"version": "16.0.1.0.0",
"version": "17.0.1.0.0",
"category": "Generic Modules/Sale",
"summary": "Product configuration interface modules for Sale",
"author": "Pledra, Odoo Community Association (OCA)",
Expand Down
3 changes: 3 additions & 0 deletions product_configurator_sale/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
6 changes: 3 additions & 3 deletions product_configurator_sale/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Product Configurator Sale</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2a027575c211693ed3abf41ce8b330ac9c76a6431a4175a21b77b26cff61350a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-configurator/tree/14.0/product_configurator_sale"><img alt="OCA/product-configurator" src="https://img.shields.io/badge/github-OCA%2Fproduct--configurator-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-configurator-14-0/product-configurator-14-0-product_configurator_sale"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-configurator&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-configurator/tree/17.0/product_configurator_sale"><img alt="OCA/product-configurator" src="https://img.shields.io/badge/github-OCA%2Fproduct--configurator-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-configurator-17-0/product-configurator-17-0-product_configurator_sale"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-configurator&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Product Configurator wizard available on Sales Orders.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand All @@ -387,7 +387,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/product-configurator/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/product-configurator/issues/new?body=module:%20product_configurator_sale%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/product-configurator/issues/new?body=module:%20product_configurator_sale%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -407,7 +407,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/PCatinean"><img alt="PCatinean" src="https://github.com/PCatinean.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/product-configurator/tree/14.0/product_configurator_sale">OCA/product-configurator</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/product-configurator/tree/17.0/product_configurator_sale">OCA/product-configurator</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion product_configurator_sale/tests/test_sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class SaleOrder(TC.ProductConfiguratorTestCases):
def setUp(self):
super(SaleOrder, self).setUp()
super().setUp()
self.SaleOrderId = self.env["sale.order"]
self.productPricelist = self.env["product.pricelist"]
self.resPartner = self.env.ref("product_configurator_sale.partenr_sale_1")
Expand Down
3 changes: 1 addition & 2 deletions product_configurator_sale/views/sale_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
class="oe_highlight"
groups="product_configurator.group_product_configurator"
name="action_config_start"
states="draft,sent"
string="Configure Product"
style="margin-top: 15px;"
type="object"
Expand All @@ -29,7 +28,7 @@
>
<field invisible="1" name="config_ok" />
<button
attrs="{ 'invisible': [ '|', ('config_ok','=',False), ('state','not in',['draft','sent']) ] }"
invisible="not config_ok or state not in ['draft','sent']"
class="fa-lg"
groups="product_configurator.group_product_configurator"
help="Reconfigure"
Expand Down
31 changes: 27 additions & 4 deletions product_configurator_sale/wizard/product_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ class ProductConfiguratorSale(models.TransientModel):
order_id = fields.Many2one(comodel_name="sale.order", required=True, readonly=True)
order_line_id = fields.Many2one(comodel_name="sale.order.line", readonly=True)

domain_attr_ids = fields.Many2many(
"product.attribute.value",
"domain_attrs_values_sale_rel",
"wiz_id",
"attribute_id",
string="Domain",
)
dyn_field_value = fields.Char()

domain_attr_2_ids = fields.Many2many(
"product.attribute.value",
"domain_attrs_2_values_sale_rel",
"wiz_id",
"attribute_id",
string="Domain",
)
dyn_field_2_value = fields.Char()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chirag-OSI I don't see these field being used anywhere. Can you explain what they are for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dreispt I have removed those unused fields.

def _get_order_line_vals(self, product_id):
"""Hook to allow custom line values to be put on the newly
created or edited lines."""
Expand All @@ -37,7 +55,7 @@ def _get_order_line_vals(self, product_id):

def action_config_done(self):
"""Parse values and execute final code before closing the wizard"""
res = super(ProductConfiguratorSale, self).action_config_done()
res = super().action_config_done()
if res.get("res_model") == self._name:
return res
model_name = "sale.order.line"
Expand All @@ -47,8 +65,13 @@ def action_config_done(self):
# will not trigger onchange automatically
order_line_obj = self.env[model_name]
cfg_session = self.config_session_id
specs = cfg_session.get_onchange_specifications(model=model_name)
updates = order_line_obj.onchange(line_vals, ["product_id"], specs)
fields_spec = cfg_session.get_onchange_specifications(model=model_name)
fields_spec = {
key: val
for key, val in fields_spec.items()
if key in list(line_vals.keys()) and key != "tax_id"
}
updates = order_line_obj.onchange(line_vals, ["product_id"], fields_spec)
values = updates.get("value", {})
values = cfg_session.get_vals_to_write(values=values, model=model_name)
values.update(line_vals)
Expand All @@ -70,7 +93,7 @@ def create(self, vals_list):
vals["custom_value_ids"] = self._get_custom_values(
sale_line.config_session_id
)
return super(ProductConfiguratorSale, self).create(vals_list)
return super().create(vals_list)

def _get_custom_values(self, session):
custom_values = [(5,)] + [
Expand Down
Loading