- Fix _compute_price_rule: use 'quantity' positional parameter instead of 'qty' - Fix stock_move: use 'quantity' instead of 'quantity_done' (Odoo 18 change) - Fix _get_price return value: extract 'value' key directly from dict - Add last_purchase_price related field in product.product for pricelist base - Remove company_dependent+required conflict (use only company_dependent) - Calculate list_price without taxes (taxes applied automatically on sales) - Add comprehensive debug logging for price calculations - Add action_update_list_price to compute theoretical price before updating - Add 3 new tests for purchase price validation and zero price handling - Fix _compute_price_rule to handle multiple tax amounts correctly |
||
|---|---|---|
| .. | ||
| data | ||
| i18n | ||
| models | ||
| tests | ||
| views | ||
| __init__.py | ||
| __manifest__.py | ||
| README.md | ||
Product Sale Price from Pricelist
Automatically calculate and update product sale prices based on the last purchase price and configurable pricelists.
Features
- Automatic Price Calculation: Set sale prices based on last purchase price and a configured pricelist
- Flexible Discount Handling: Choose how to apply discounts to the cost:
- Without discounts
- First discount only
- Double discount
- Triple discount
- Manual update
- Tax-Aware Pricing: Automatically includes tax calculations in pricing
- UoM Conversion: Handles different purchase and sale units of measure
- Batch Updates: Update theoretical prices for multiple products
- Product Flags: Mark products for price updates and track status
Configuration
- Settings > Sales > Automatic Price Configuration: Select the pricelist for automatic price calculation
- Products > Products: Configure per product:
- Last purchase price: Cost at which the product was last purchased
- Last purchase price calculation type: Choose how to apply discounts
- Mark Last purchase price updated when prices need to be reviewed
Price Calculation Types
- Without Discounts: Uses base purchase price without discounts
- First Discount: Applies only the first discount
- Double Discount: Applies first and second discount
- Triple Discount: Applies first, second, and third discount
- Manual Update: Price must be set manually
Usage
- Products are priced when received from purchase orders
- System automatically updates last_purchase_price field
- Sale price is calculated from the configured pricelist using the cost price
- Taxes are automatically applied based on product tax settings
- Go to Products > Update Theoretical Prices to batch update prices
License
AGPL-3.0 or later