From 98b1880495033fbafdb811a7d432f8ab483fa761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 15 Jun 2015 00:58:43 +0200 Subject: [PATCH] Add recompute cost price method for FIFO issue4729 review15221002 --- __init__.py | 1 + product.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 1c98c7ae68..06b209fe2b 100644 --- a/__init__.py +++ b/__init__.py @@ -8,5 +8,6 @@ from .move import * def register(): Pool.register( Template, + Product, Move, module='product_cost_fifo', type_='model') diff --git a/product.py b/product.py index 5d6b68093e..b2f15ad852 100644 --- a/product.py +++ b/product.py @@ -4,7 +4,7 @@ import datetime from trytond.transaction import Transaction from trytond.pool import Pool, PoolMeta -__all__ = ['Template'] +__all__ = ['Template', 'Product'] __metaclass__ = PoolMeta @@ -72,3 +72,10 @@ class Template: fifo_moves.reverse() return fifo_moves + + +class Product: + __name__ = 'product.product' + + def recompute_cost_price_fifo(self): + return self.recompute_cost_price_average()