mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
MIG stock_landed_costs_average For Odoo 12.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
'name': 'Landed Costs Average',
|
'name': 'Landed Costs Average',
|
||||||
'summary': 'Use Landed Costs on Average Cost inventory.',
|
'summary': 'Use Landed Costs on Average Cost inventory.',
|
||||||
'version': '11.0.1.0.0',
|
'version': '12.0.1.0.0',
|
||||||
'author': "Hibou Corp. <hello@hibou.io>",
|
'author': "Hibou Corp. <hello@hibou.io>",
|
||||||
'category': 'Warehouse',
|
'category': 'Warehouse',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
|
|||||||
@@ -56,10 +56,10 @@ class LandedCost(models.Model):
|
|||||||
}
|
}
|
||||||
for line in cost.valuation_adjustment_lines.filtered(lambda line: line.move_id):
|
for line in cost.valuation_adjustment_lines.filtered(lambda line: line.move_id):
|
||||||
# Prorate the value at what's still in stock
|
# Prorate the value at what's still in stock
|
||||||
_logger.warn('(line.move_id.remaining_qty / line.move_id.product_qty) * line.additional_landed_cost')
|
_logger.info('(line.move_id.remaining_qty / line.move_id.product_qty) * line.additional_landed_cost')
|
||||||
_logger.warn('(%s / %s) * %s' % (line.move_id.remaining_qty, line.move_id.product_qty, line.additional_landed_cost))
|
_logger.info('(%s / %s) * %s' % (line.move_id.remaining_qty, line.move_id.product_qty, line.additional_landed_cost))
|
||||||
cost_to_add = (line.move_id.remaining_qty / line.move_id.product_qty) * line.additional_landed_cost
|
cost_to_add = (line.move_id.remaining_qty / line.move_id.product_qty) * line.additional_landed_cost
|
||||||
_logger.warn('cost_to_add: ' + str(cost_to_add))
|
_logger.info('cost_to_add: ' + str(cost_to_add))
|
||||||
|
|
||||||
new_landed_cost_value = line.move_id.landed_cost_value + line.additional_landed_cost
|
new_landed_cost_value = line.move_id.landed_cost_value + line.additional_landed_cost
|
||||||
line.move_id.write({
|
line.move_id.write({
|
||||||
|
|||||||
Reference in New Issue
Block a user