From 322d221d354f610c117a1ea57d50a9418118106d Mon Sep 17 00:00:00 2001 From: AjmalCybro Date: Fri, 30 Sep 2022 16:24:59 +0530 Subject: [PATCH] Sep 30 : [UPDT] Bug Fix 'stock_last_purchase_price' --- stock_last_purchase_price/__manifest__.py | 2 +- stock_last_purchase_price/models/stock.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stock_last_purchase_price/__manifest__.py b/stock_last_purchase_price/__manifest__.py index 89ee9e52b..4c4a1cd70 100644 --- a/stock_last_purchase_price/__manifest__.py +++ b/stock_last_purchase_price/__manifest__.py @@ -22,7 +22,7 @@ { 'name': 'Costing method: Last Purchase Price', - 'version': '15.0.1.0.1', + 'version': '15.0.1.0.2', 'category': 'Inventory', 'summary': "Introducing new costing method in Odoo 'last purchase price'", 'author': 'Cybrosys Techno solutions', diff --git a/stock_last_purchase_price/models/stock.py b/stock_last_purchase_price/models/stock.py index c0a2651e1..cf7d1cdde 100644 --- a/stock_last_purchase_price/models/stock.py +++ b/stock_last_purchase_price/models/stock.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from collections import defaultdict -from odoo import api, models +from odoo import api, models, _ from odoo.exceptions import UserError from odoo.tools import float_is_zero @@ -32,7 +32,7 @@ class StockMove(models.Model): qty_done = move.product_uom._compute_quantity(move.quantity_done, move.product_id.uom_id) qty = forced_qty or qty_done new_std_price = ((amount_unit * product_tot_qty_available) + (move._get_price_unit() * qty)) / (product_tot_qty_available + qty_done) - if move.product_id.cost_method == 'last' and move.product_id.valuation == 'real_time': + if move.product_id.cost_method == 'last' and move.product_id.valuation == 'real_time' or move.product_id.valuation == 'manual_periodic': new_std_price = move._get_price_unit() products = self.env['product.product'].browse(move.product_id.id) account_id = products.property_account_creditor_price_difference.id or products.categ_id.property_account_creditor_price_difference_categ.id