Browse Source

Sep 30 : [UPDT] Bug Fix 'stock_last_purchase_price'

pull/219/head
AjmalCybro 3 years ago
parent
commit
322d221d35
  1. 2
      stock_last_purchase_price/__manifest__.py
  2. 4
      stock_last_purchase_price/models/stock.py

2
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',

4
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

Loading…
Cancel
Save