- 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) |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_total_margin.py | ||