addons-cm/product_pricelist_total_margin/views
snt 449bb75bb6 [IMP] product_pricelist_total_margin: Add global_margin_type for min/max limits
- Add global_margin_type field in res.config.settings
  * Options: 'markup' (default) or 'margin' (commercial margin)
  * Determines how global min/max percentages are interpreted
- Refactor _apply_global_margin_limits():
  * Now receives price instead of margin percentage
  * Calculates min/max prices based on global_margin_type
  * Returns adjusted price instead of adjusted margin
  * Supports both markup and commercial margin formulas
- Update _compute_price() to apply limits after price calculation
- Update res_config_settings_views.xml to show global_margin_type selector
- Update help texts with examples for both calculation methods
- Add 2 new tests to validate global limits with commercial margin type:
  * test_global_minimum_with_commercial_margin_type
  * test_global_maximum_with_commercial_margin_type
- All 13 tests passing (11 existing + 2 new)

Example with global min 25%:
- Markup: Min price = Cost × 1.25
- Commercial Margin: Min price = Cost / 0.75 (ensures 25% margin on PVP)
2026-02-21 19:16:16 +01:00
..
product_pricelist_item_views.xml [IMP] product_pricelist_total_margin: Add margin_type selector (Markup vs Commercial Margin) 2026-02-21 18:54:38 +01:00
res_config_settings_views.xml [IMP] product_pricelist_total_margin: Add global_margin_type for min/max limits 2026-02-21 19:16:16 +01:00