This commit is contained in:
Cédric Krier committed 2012-03-27 10:45:11 +02:00
commit bde2ff9edb
2 files changed
+4 -26

No files matched your search

+1
View File
@@ -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
+3 -26
View File
@@ -205,6 +205,9 @@ class Move(ModelSQL, ModelView):
company = company_obj.browse(company)
return company.currency.id
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'):
@@ -342,32 +345,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):
"""