Browse Source

[FIX] Bug Fixed ''stock_last_purchase_price

pull/150/head
Ajmal JK 5 years ago
parent
commit
9eb3928f4d
  1. 2
      stock_last_purchase_price/__manifest__.py
  2. 3
      stock_last_purchase_price/models/product.py

2
stock_last_purchase_price/__manifest__.py

@ -22,7 +22,7 @@
{
'name': 'Costing method: Last Purchase Price',
'version': '12.0.1.0.0',
'version': '12.0.1.0.1',
'category': 'Inventory',
'summary': "Introducing new costing method in Odoo 'last purchase price'",
'author': 'Cybrosys Techno solutions',

3
stock_last_purchase_price/models/product.py

@ -58,8 +58,7 @@ class ProductProduct(models.Model):
product_accounts = {product.id: product.product_tmpl_id.get_product_accounts() for product in self}
for product in self.with_context().filtered(lambda r: r.valuation == 'real_time'):
diff = product.standard_price - new_price
if float_is_zero(diff, precision_rounding=product.currency_id.rounding):
raise UserError(_("No difference between the standard price and the new price."))
if not float_is_zero(diff, precision_rounding=product.currency_id.rounding):
if not product_accounts[product.id].get('stock_valuation', False):
raise UserError(_('You don\'t have any stock valuation account defined on your product category. You must define one before processing this operation.'))
qty_available = product.qty_available

Loading…
Cancel
Save