addons-cm/website_sale_aplicoop/tests
GitHub Copilot 817ff31d39 [REF] website_sale_aplicoop: price through website_sale instead of privately
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>
2026-08-17 17:28:51 +02:00
..
__init__.py [REF] website_sale_aplicoop: price through website_sale instead of privately 2026-08-17 17:28:51 +02:00
COBERTURA_TESTS_ANALISIS.md [FIX] website_sale_aplicoop: Remove redundant string= attributes and fix OCA linting warnings 2026-02-18 17:54:43 +01:00
PHASE3_TEST_SUMMARY.md [DOC] website_sale_aplicoop: Add lazy loading documentation and implement v18.0.1.3.0 feature 2026-02-16 18:39:39 +01:00
test_cron_picking_batch.py [IMP] website_sale_aplicoop: automate non-weekly group order cycles 2026-07-15 16:26:14 +02:00
test_date_calculations.py [FIX] website_sale_aplicoop: harden group order cron 2026-03-31 19:36:20 +02:00
test_date_edge_cases.py [ADD] website_sale_aplicoop: restore the test coverage lost with the dead code 2026-08-17 17:24:31 +02:00
test_eskaera_shop.py [FIX] website_sale_aplicoop: Remove redundant string= attributes and fix OCA linting warnings 2026-02-18 17:54:43 +01:00
test_forecasted_stock.py [IMP] website_sale_aplicoop: filter and cap stock using forecasted net qty 2026-06-12 18:18:40 +02:00
test_group_order.py [REF] Code quality improvements and structure fixes 2026-02-21 13:51:25 +01:00
test_group_order_slug.py [FIX] website_sale_aplicoop: three defects in the group order slug 2026-08-11 22:53:09 +02:00
test_group_order_status_endpoint.py [FIX] website_sale_aplicoop: scope draft lookup to active cycle window 2026-05-29 17:40:48 +02:00
test_home_delivery.py [TEST] website_sale_aplicoop: add tests for home_delivery computed field 2026-05-20 17:49:50 +02:00
test_multi_company.py [FIX] website_sale_aplicoop: lint fixes (exception chaining, imports, remove unused vars) 2026-05-20 16:05:14 +02:00
test_online_payment.py [ADD] website_sale_aplicoop: online payment per group order 2026-08-16 21:59:35 +02:00
test_phase3_confirm_eskaera.py [REF] website_sale_aplicoop: price through website_sale instead of privately 2026-08-17 17:28:51 +02:00
test_portal_routes.py [ADD] website_sale_aplicoop: restore the test coverage lost with the dead code 2026-08-17 17:24:31 +02:00
test_portal_sale_order_creation.py feat(website_sale_aplicoop): ordenar productos por website_sequence y nombre 2026-02-25 19:34:49 +01:00
test_price_with_taxes_included.py [ADD] website_sale_aplicoop: restore the test coverage lost with the dead code 2026-08-17 17:24:31 +02:00
test_pricing_delegation.py [REF] website_sale_aplicoop: price through website_sale instead of privately 2026-08-17 17:28:51 +02:00
test_pricing_with_pricelist.py [REF] website_sale_aplicoop: price through website_sale instead of privately 2026-08-17 17:28:51 +02:00
test_product_discovery.py [ADD] website_sale_aplicoop: restore the test coverage lost with the dead code 2026-08-17 17:24:31 +02:00
test_product_extension.py [FIX] website_sale_aplicoop: Remove redundant string= attributes and fix OCA linting warnings 2026-02-18 17:54:43 +01:00
test_record_rules.py [FIX] website_sale_aplicoop: lint fixes (exception chaining, imports, remove unused vars) 2026-05-20 16:05:14 +02:00
test_res_partner.py [IMP] website_sale_aplicoop: propagate consumer_group_id directly from group_order 2026-03-06 13:49:13 +01:00
test_save_order_endpoints.py [TEST] website_sale_aplicoop: add tests for home_delivery computed field 2026-05-20 17:49:50 +02:00
test_templates_rendering.py [FIX] Resolver 3 fallos de tests en website_sale_aplicoop 2026-03-30 16:21:57 +02:00