Point of Sale mailing list archives
pos@odoo-community.org
Browse archives
Re: [OCA/pos] [12.0] ADD pos_product_multi_price: Make pricelists based on product_multi_price work in point of sale (#541)
[OCA/pos] Run failed: pre-commit - 14.0 (bb3a6c2)
Re: [OCA/pos] [12.0] ADD pos_product_multi_price: Make pricelists based on product_multi_price work in point of sale (#541)
by "qgroulard" <notifications@github.com> - 07/04/2021 11:18:22@qgroulard commented on this pull request.
In pos_product_multi_price/static/src/js/models.js:
> + _.find(pricelist_items, function (rule) { + if (rule.min_quantity && quantity < rule.min_quantity) { + return false; + } + if (rule.base === 'multi_price' && rule.compute_price == 'formula') { + _.forEach(price_ids_json, function (multi_price) { + if (multi_price.price_id == rule.multi_price_name[0]) { + price = multi_price.price; + var price_limit = price; + price = price - (price * (rule.price_discount / 100)); + if (rule.price_round) { + price = round_pr(price, rule.price_round); + } + if (rule.price_surcharge) { + price += rule.price_surcharge; + } + if (rule.price_min_margin) { + price = Math.max(price, price_limit + rule.price_min_margin); + } + if (rule.price_max_margin) { + price = Math.min(price, price_limit + rule.price_max_margin); + } + return true; + } + }); + } + return false + });
Here you ignore possible high-priority rules not based on multi_price.
Price set by those high-priority rules will be overridden by the multi_price.
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.