From 7b3caee98d5b012d8a6f9f00aed2eafe90749649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Fri, 7 Sep 2012 15:51:58 +0200 Subject: [PATCH] Updating cost price must update stock accounting review244003 --- CHANGELOG | 2 + account.py | 6 +- account.xml | 2 + configuration.py | 15 ++++ configuration.xml | 23 ++++++ product.py | 183 +++++++++++++++++++++++++++++++++++++++++++++- product.xml | 50 ++++++++++++- 7 files changed, 278 insertions(+), 3 deletions(-) create mode 100644 configuration.py create mode 100644 configuration.xml diff --git a/CHANGELOG b/CHANGELOG index ac649ee2e9..904e369bfb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Updating cost price must update stock accounting + Version 2.4.0 - 2012-04-23 * Bug fixes (see mercurial logs for details) * Create move also from supplier to customer diff --git a/account.py b/account.py index 3ebcaa91ac..4d677fad21 100644 --- a/account.py +++ b/account.py @@ -1,7 +1,7 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. from trytond.model import Model, fields -from trytond.pyson import Eval, Bool +from trytond.pyson import Eval, Bool, Get class Configuration(Model): @@ -12,5 +12,9 @@ class Configuration(Model): states={ 'required': Bool(Eval('context', {}).get('company')), })) + cost_price_counterpart_account = fields.Property(fields.Many2One( + 'account.account', 'Cost Price Counterpart Account', domain=[ + ('company', 'in', [Get(Eval('context', {}), 'company'), None]), + ])) Configuration() diff --git a/account.xml b/account.xml index 3817036ab0..1482cee775 100644 --- a/account.xml +++ b/account.xml @@ -15,6 +15,8 @@ this repository contains the full copyright notices and license terms. -->