From 21e0247eeff319c7abd5e63bf9f797c458fdeffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 26 Mar 2012 14:41:47 +0200 Subject: [PATCH 1/2] Remove special to_location_warehouse search clause --- CHANGELOG | 1 + move.py | 26 -------------------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index de213c626c..a84f5b366d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Remove special to_location_warehouse search clause * Remove default from and to location and instead use domain * Update cost_price only from supplier to storage diff --git a/move.py b/move.py index d48f398a6b..25d27afdb9 100644 --- a/move.py +++ b/move.py @@ -343,32 +343,6 @@ class Move(ModelSQL, ModelView): def search_rec_name(self, name, clause): return [('product',) + clause[1:]] - def search(self, args, offset=0, limit=None, order=None, count=False, - query_string=False): - location_obj = Pool().get('stock.location') - - args = args[:] - def process_args(args): - i = 0 - while i < len(args): - #add test for xmlrpc that doesn't handle tuple - if (isinstance(args[i], tuple) or \ - (isinstance(args[i], list) and len(args[i]) > 2 and \ - args[i][1] in OPERATORS)) and \ - args[i][0] == 'to_location_warehouse': - location_id = False - if args[i][2]: - location = location_obj.browse(args[i][2]) - if location.type == 'warehouse': - location_id = location.input_location.id - args[i] = ('to_location', args[i][1], location_id) - elif isinstance(args[i], list): - process_args(args[i]) - i += 1 - process_args(args) - return super(Move, self).search(args, offset=offset, limit=limit, - order=order, count=count, query_string=query_string) - def _update_product_cost_price(self, product_id, quantity, uom, unit_price, currency, company, date): """ From 3a7777aa98ba757772bdd8fdbf9d514c3690c289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 26 Mar 2012 14:42:50 +0200 Subject: [PATCH 2/2] Missing default_unit_digits on move --- move.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/move.py b/move.py index 25d27afdb9..fa8fd56378 100644 --- a/move.py +++ b/move.py @@ -206,6 +206,9 @@ class Move(ModelSQL, ModelView): return company.currency.id return False + def default_unit_digits(self): + return 2 + def on_change_with_unit_digits(self, vals): uom_obj = Pool().get('product.uom') if vals.get('uom'):