Eskaera carried its own pricing path: a `website_sale_aplicoop.pricelist_id` setting resolved inside the Eskaera controllers, plus a local reimplementation of the tax and discount maths. The pricelist part meant /shop and Eskaera could quote different prices on the same website, and the maths part had drifted from the original it was copied from. Pricing is now the standard one. The setting is gone (a migration drops the parameter, which would otherwise linger looking like live configuration) and `_resolve_pricelist` is `request.website.pricelist_id`. Scoping a pricelist to a website is already core's job through `product.pricelist.website_id`, so running the plain shop on one website and the co-op on another needs no code here. Taxes are applied by `product.template._apply_taxes_to_price`, which fixes a real defect: it calls `_get_tax_included_unit_price_from_price` first, and this module did not. With a fiscal position remapping a tax-included tax, a product at 121 (100 + 21%) was displayed at 121 instead of 110, because the price was handed to the mapped tax as if it were already that tax's gross amount. The helper is a no-op without a remapping, so ordinary pricing is untouched. It also means the website's `show_line_subtotals_tax_selection` is respected rather than overridden with a hardcoded tax-included display. Listing a page now costs one `_compute_price_rule` call instead of one per product, which matters on the lazy-loading path. Two smaller things found on the way. `_get_product_price_rule` was being passed `target_currency=`, which is not one of its arguments: it fell into **kwargs and was ignored, so the conversion never happened. And `_compute_price_info` resolved `product.product_variant_ids[0]`, but it receives variants, so a multi-variant template was priced from its first variant rather than the one asked for. The delivery display price loses its hardcoded 5.74 fallback and reuses the same helpers as everything else. Kept local, because none of it is pricing: the /Kg and /L suffixes, the 0.1 quantity step for bulk goods, the base unit price and the supplier name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
57 lines
3 KiB
XML
57 lines
3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<record id="res_config_settings_view_form" model="ir.ui.view">
|
|
<field name="name">res.config.settings.view.form.inherit.aplicoop</field>
|
|
<field name="model">res.config.settings</field>
|
|
<field name="inherit_id" ref="website.res_config_settings_view_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//block[@id='website_info_settings']" position="after">
|
|
<h2>Shop Performance</h2>
|
|
<div class="row mt16 o_settings_container" id="eskaera_shop_settings">
|
|
<div class="col-12 col-lg-6 o_setting_box">
|
|
<div class="o_setting_left_pane"/>
|
|
<div class="o_setting_right_pane">
|
|
<label for="eskaera_lazy_loading_enabled" string="Enable Lazy Loading"/>
|
|
<div class="text-muted">
|
|
Load products in pages instead of all at once
|
|
</div>
|
|
<div class="content-group">
|
|
<div class="mt16">
|
|
<field name="eskaera_lazy_loading_enabled" class="oe_inline"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-lg-6 o_setting_box">
|
|
<div class="o_setting_left_pane"/>
|
|
<div class="o_setting_right_pane">
|
|
<label for="eskaera_products_per_page" string="Products Per Page"/>
|
|
<div class="text-muted">
|
|
Number of products to load on initial page
|
|
</div>
|
|
<div class="content-group">
|
|
<div class="mt16">
|
|
<field name="eskaera_products_per_page" class="oe_inline"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-lg-6 o_setting_box">
|
|
<div class="o_setting_left_pane"/>
|
|
<div class="o_setting_right_pane">
|
|
<label for="low_stock_threshold" string="Low Stock Threshold"/>
|
|
<div class="text-muted">
|
|
Products with stock ≤ this value show "Low Stock" ribbon. Stock = 0 shows "Out of Stock" ribbon.
|
|
</div>
|
|
<div class="content-group">
|
|
<div class="mt16">
|
|
<field name="low_stock_threshold" class="oe_inline"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
</odoo>
|