Hi,
Hi,
While changing the product variant a javascript function (_onChangeCombination) is running behind to get the product detail of the variant. You can overide the function to change the default product code according to the attribute change.
First add the following code in the html view (<template id="product">) inside the div
<div class="js_product js_main_product">
<span t-attf-class="default_code" t-field="product.default_code"/>
</div>
then inherit the javascript function (_onChangeCombination) and find the html element.
var $default_code = $parent.find(".default_code");
provide the value for the variable.
$default_code.text(combination.default_code);
You can pass the default_code from the python fuction _get_combination_info()
'default_code': product.default_code
Regards