Skip to Content
Menu

Purchase Price Subtotal Sync

by
Odoo
v 18.0 Third Party 53
Download for v 18.0 Deploy on Odoo.sh Live Preview
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Purchase (purchase)
Invoicing (account)
Discuss (mail)
Lines of code 49
Technical Name an_purchase_price_subtotal_sync
LicenseAGPL-3
Websitehttp://www.odoosa.net
Versions 16.0 17.0 18.0
You bought this module and need support? Click here!

Purchase Price Subtotal Sync

Bidirectional Synchronization Between Price Unit and Subtotal

Key Features

  • Automatic update of price_subtotal when price_unit or product_qty changes
  • Automatic recalculation of price_unit when price_subtotal is manually updated
  • Real-time bidirectional synchronization for accurate pricing
  • Error handling for scenarios with zero quantity
  • Seamless integration with Odoo's native Purchase module

How It Works

  1. Update Price Unit: Enter a new price unit, and the subtotal will automatically update based on the quantity.
  2. Update Quantity: Change the product quantity, and the subtotal will automatically update while keeping the unit price constant.
  3. Update Subtotal: Manually change the subtotal, and the unit price will automatically recalculate based on the quantity.

Business Benefits

For Procurement Teams

  • Faster data entry when creating purchase orders
  • Greater flexibility in price negotiations
  • Reduced manual calculation errors
  • Option to work with total costs or unit prices based on preference

For Finance Teams

  • Improved accuracy in purchase cost accounting
  • Easier reconciliation of purchase orders
  • Better cost control and visibility
  • Streamlined approval processes

Technical Details

This module extends the purchase.order.line model to enable bidirectional synchronization:

  • Overrides the price_subtotal field to make it writable
  • Implements the _inverse_price_subtotal method to update unit price when subtotal changes
  • Uses @api.onchange decorators to ensure real-time updates in the UI
  • Implements proper error handling for edge cases

Compatibility

Compatible with Odoo 18.0 Community and Enterprise Editions

Support

For any questions or support, please contact:

Ahmed Nour
Email: ahmednour@outlook.com
Website: www.odoosa.net

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.