Hello community, here is the log from the commit of package trytond_stock for openSUSE:Factory checked in at 2017-08-18 15:04:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/trytond_stock (Old) and /work/SRC/openSUSE:Factory/.trytond_stock.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "trytond_stock" Fri Aug 18 15:04:16 2017 rev:5 rq:517035 version:4.2.3 Changes: -------- --- /work/SRC/openSUSE:Factory/trytond_stock/trytond_stock.changes 2017-07-05 23:56:22.785632203 +0200 +++ /work/SRC/openSUSE:Factory/.trytond_stock.new/trytond_stock.changes 2017-08-18 15:04:20.798639234 +0200 @@ -1,0 +2,5 @@ +Thu Aug 10 20:04:25 UTC 2017 - [email protected] + +- Version 4.2.3 + +------------------------------------------------------------------- Old: ---- trytond_stock-4.2.2.tar.gz New: ---- trytond_stock-4.2.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ trytond_stock.spec ++++++ --- /var/tmp/diff_new_pack.9Wz6yd/_old 2017-08-18 15:04:23.054321538 +0200 +++ /var/tmp/diff_new_pack.9Wz6yd/_new 2017-08-18 15:04:23.058320975 +0200 @@ -19,7 +19,7 @@ %define majorver 4.2 Name: trytond_stock -Version: %{majorver}.2 +Version: %{majorver}.3 Release: 0 Summary: The "stock" module for the Tryton ERP system License: GPL-3.0 ++++++ trytond_stock-4.2.2.tar.gz -> trytond_stock-4.2.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond_stock-4.2.2/CHANGELOG new/trytond_stock-4.2.3/CHANGELOG --- old/trytond_stock-4.2.2/CHANGELOG 2017-07-01 23:44:01.000000000 +0200 +++ new/trytond_stock-4.2.3/CHANGELOG 2017-08-08 18:36:58.000000000 +0200 @@ -1,3 +1,6 @@ +Version 4.2.3 - 2017-08-08 +* Bug fixes (see mercurial logs for details) + Version 4.2.2 - 2017-07-01 * Bug fixes (see mercurial logs for details) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond_stock-4.2.2/PKG-INFO new/trytond_stock-4.2.3/PKG-INFO --- old/trytond_stock-4.2.2/PKG-INFO 2017-07-01 23:44:02.000000000 +0200 +++ new/trytond_stock-4.2.3/PKG-INFO 2017-08-08 18:36:59.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: trytond_stock -Version: 4.2.2 +Version: 4.2.3 Summary: Tryton module for stock and inventory Home-page: http://www.tryton.org/ Author: Tryton diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond_stock-4.2.2/inventory.py new/trytond_stock-4.2.3/inventory.py --- old/trytond_stock-4.2.2/inventory.py 2016-11-28 18:39:12.000000000 +0100 +++ new/trytond_stock-4.2.3/inventory.py 2017-08-08 18:36:56.000000000 +0200 @@ -266,7 +266,6 @@ class InventoryLine(ModelSQL, ModelView): 'Stock Inventory Line' __name__ = 'stock.inventory.line' - _rec_name = 'product' _states = { 'readonly': Eval('inventory_state') != 'draft', } @@ -357,6 +356,10 @@ def get_rec_name(self, name): return self.product.rec_name + @classmethod + def search_rec_name(cls, name, clause): + return [('product',) + tuple(clause[1:])] + def get_uom(self, name): return self.product.default_uom.id diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond_stock-4.2.2/location.py new/trytond_stock-4.2.3/location.py --- old/trytond_stock-4.2.2/location.py 2016-11-28 18:39:12.000000000 +0100 +++ new/trytond_stock-4.2.3/location.py 2017-08-08 18:36:56.000000000 +0200 @@ -176,15 +176,19 @@ """ Check locations with moves have types compatible with moves. """ invalid_move_types = ['warehouse', 'view'] Move = Pool().get('stock.move') - if (self.type in invalid_move_types - and Move.search([ + if self.type in invalid_move_types: + # Use root to compute for all companies + with Transaction().set_user(0): + moves = Move.search([ ['OR', ('to_location', '=', self.id), ('from_location', '=', self.id), ], ('state', 'not in', ['staging', 'draft']), - ])): - self.raise_user_error('invalid_type_for_moves', (self.rec_name,)) + ]) + if moves: + self.raise_user_error( + 'invalid_type_for_moves', (self.rec_name,)) @staticmethod def default_active(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond_stock-4.2.2/move.py new/trytond_stock-4.2.3/move.py --- old/trytond_stock-4.2.2/move.py 2016-11-28 18:39:12.000000000 +0100 +++ new/trytond_stock-4.2.3/move.py 2017-08-08 18:36:56.000000000 +0200 @@ -82,10 +82,12 @@ return quantities product_ids = products and [p.id for p in products] or None + with_childs = Transaction().context.get( + 'with_childs', len(location_ids) == 1) with Transaction().set_context(cls._quantity_context(name)): pbl = Product.products_by_location(location_ids=location_ids, - product_ids=product_ids, with_childs=True, + product_ids=product_ids, with_childs=with_childs, grouping=grouping) for key, quantity in pbl.iteritems(): @@ -113,47 +115,35 @@ whose quantity is computed. """ pool = Pool() - Location = pool.get('stock.location') - Move = pool.get('stock.move') + Product = pool.get('product.product') if not location_ids or not domain: return [] - - # Skip warehouse location in favor of their storage location - # to compute quantities. Keep track of which ids to remove - # and to add after the query. - if Transaction().context.get('stock_skip_warehouse'): - location_ids = set(location_ids) - for location in Location.browse(list(location_ids)): - if location.type == 'warehouse': - location_ids.remove(location.id) - location_ids.add(location.storage_location.id) - location_ids = list(location_ids) + with_childs = Transaction().context.get( + 'with_childs', len(location_ids) == 1) with Transaction().set_context(cls._quantity_context(name)): - query = Move.compute_quantities_query(location_ids, - with_childs=True, grouping=grouping, - grouping_filter=None) - having_domain = getattr(cls, name)._field.convert_domain(domain, { - None: (query, {}), - }, cls) - # The last column of 'query' is always the quantity for the 'key'. - # It is computed with a SUM() aggregator so in having we have to - # use the SUM() expression and not the name of column - having_domain.left = query.columns[-1].expression - if query.having: - query.having &= having_domain - else: - query.having = having_domain - quantities = Move.compute_quantities(query, location_ids, - with_childs=True, grouping=grouping, - grouping_filter=None) + pbl = Product.products_by_location( + location_ids=location_ids, with_childs=with_childs, + grouping=grouping) + _, operator_, operand = domain + operator_ = { + '=': operator.eq, + '>=': operator.ge, + '>': operator.gt, + '<=': operator.le, + '<': operator.lt, + '!=': operator.ne, + 'in': lambda v, l: v in l, + 'not in': lambda v, l: v not in l, + }.get(operator_, lambda v, l: False) record_ids = [] - for key, quantity in quantities.iteritems(): - # pbl could return None in some keys - if key[position] is not None: - record_ids.append(key[position]) + for key, quantity in pbl.iteritems(): + if operator_(quantity, operand): + # pbl could return None in some keys + if key[position] is not None: + record_ids.append(key[position]) return [('id', 'in', record_ids)] @@ -560,6 +550,7 @@ locations = Location.search([ ('type', '=', 'storage'), ]) + context['with_childs'] = False context['locations'] = [l.id for l in locations] context['stock_date_end'] = Date.today() with Transaction().set_context(context): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond_stock-4.2.2/period.py new/trytond_stock-4.2.3/period.py --- old/trytond_stock-4.2.2/period.py 2016-11-28 18:39:12.000000000 +0100 +++ new/trytond_stock-4.2.3/period.py 2017-08-08 18:36:56.000000000 +0200 @@ -13,7 +13,6 @@ class Period(Workflow, ModelSQL, ModelView): 'Stock Period' __name__ = 'stock.period' - _rec_name = 'date' date = fields.Date('Date', required=True, states={ 'readonly': Eval('state') == 'closed', }, depends=['state']) @@ -71,6 +70,10 @@ return pool.get('stock.period.cache') @classmethod + def get_rec_name(self, name): + return str(self.date) + + @classmethod @ModelView.button @Workflow.transition('draft') def draft(cls, periods): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond_stock-4.2.2/tryton.cfg new/trytond_stock-4.2.3/tryton.cfg --- old/trytond_stock-4.2.2/tryton.cfg 2017-03-10 10:44:46.000000000 +0100 +++ new/trytond_stock-4.2.3/tryton.cfg 2017-07-01 23:44:16.000000000 +0200 @@ -1,5 +1,5 @@ [tryton] -version=4.2.2 +version=4.2.3 depends: company currency diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond_stock-4.2.2/trytond_stock.egg-info/PKG-INFO new/trytond_stock-4.2.3/trytond_stock.egg-info/PKG-INFO --- old/trytond_stock-4.2.2/trytond_stock.egg-info/PKG-INFO 2017-07-01 23:44:02.000000000 +0200 +++ new/trytond_stock-4.2.3/trytond_stock.egg-info/PKG-INFO 2017-08-08 18:36:59.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: trytond-stock -Version: 4.2.2 +Version: 4.2.3 Summary: Tryton module for stock and inventory Home-page: http://www.tryton.org/ Author: Tryton
