Skip to content

Commit

Permalink
[FIX]Refreash issue on Next button.
Browse files Browse the repository at this point in the history
[IMP]IMP Code.
  • Loading branch information
Vandan-OSI committed Jun 27, 2024
1 parent a6baba3 commit 47eaede
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions product_configurator/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"/product_configurator/static/src/js/boolean_button_widget.esm.js",
"/product_configurator/static/src/js/boolean_button_widget.xml",
"/product_configurator/static/src/js/relational_fields.esm.js",
"/product_configurator/static/src/js/view.js",
]
},
"demo": [
Expand Down
14 changes: 14 additions & 0 deletions product_configurator/static/src/js/view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @odoo-module **/

import {patch} from "@web/core/utils/patch";
import { View } from "@web/views/view";

patch(View.prototype, {
async loadView(props){
var element = super.loadView(...arguments);
if (this?.props?.context?.is_product_configurator){
this.env.bus.trigger("CLEAR-CACHES");
}
return element
},
});
3 changes: 2 additions & 1 deletion product_configurator/wizard/product_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def apply_onchange_values(self, values, field_name, field_onchange):
cfg_step = self.env["product.config.step.line"]

Check warning on line 303 in product_configurator/wizard/product_configurator.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/wizard/product_configurator.py#L303

Added line #L303 was not covered by tests

dynamic_fields = {k: v for k, v in values.items() if k.startswith(field_prefix)}

self.dyn_field_2_value = False

Check warning on line 306 in product_configurator/wizard/product_configurator.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/wizard/product_configurator.py#L306

Added line #L306 was not covered by tests
# Get the unstored values from the client view
for k, v in dynamic_fields.items():
attr_id = int(k.split(field_prefix)[1])
Expand Down Expand Up @@ -1040,6 +1040,7 @@ def get_wizard_action(self, view_cache=False, wizard=None):
{
"view_cache": view_cache,
"differentiator": ctx.get("differentiator", 1) + 1,
"is_product_configurator":True,
}
)
if wizard:
Expand Down

0 comments on commit 47eaede

Please sign in to comment.