From 62e94d54c45867ac7f44a99567859fc83f229ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 8 May 2009 00:23:48 +0200 Subject: [PATCH 01/52] Set default value for left and right when copying location --- location.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/location.py b/location.py index a4c3bcdfba..65e70640c4 100644 --- a/location.py +++ b/location.py @@ -224,6 +224,14 @@ class Location(ModelSQL, ModelView): self._set_warehouse_parent(cursor, user, locations, context=context) return res + def copy(self, cursor, user, ids, default=None, context=None): + if default is None: + default = {} + default['left'] = 0 + default['right'] = 0 + return super(Location, self).copy(cursor, user, ids, default=default, + context=context) + Location() From 99cf1ec68a65e28e0a5ec785320ff6cbfaeea0fa Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Mon, 11 May 2009 10:55:41 +0200 Subject: [PATCH 02/52] Fix: handle warehouse duplication --- location.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/location.py b/location.py index 65e70640c4..e78de8d034 100644 --- a/location.py +++ b/location.py @@ -227,10 +227,56 @@ class Location(ModelSQL, ModelView): def copy(self, cursor, user, ids, default=None, context=None): if default is None: default = {} + int_id = False + if isinstance(ids, (int, long)): + int_id = True + ids = [ids] + default['left'] = 0 default['right'] = 0 - return super(Location, self).copy(cursor, user, ids, default=default, - context=context) + + res = [] + locations = self.browse(cursor, user, ids, context=context) + for location in locations: + if location.type == 'warehouse': + + wh_default = default.copy() + wh_default['type'] = 'view' + wh_default['input_location'] = False + wh_default['output_location'] = False + wh_default['storage_location'] = False + wh_default['childs'] = False + + new_id = super(Location, self).copy( + cursor, user, location.id, default=wh_default, + context=context) + + child_context = context and context.copy() or {} + child_context['cp_warehouse_locations'] = { + 'input_location': location.input_location.id, + 'output_location': location.output_location.id, + 'storage_location': location.storage_location.id} + child_context['cp_warehouse_id'] = new_id + + self.copy( + cursor, user, [c.id for c in location.childs], + default={'parent':new_id}, context=child_context) + self.write( + cursor, user, new_id, {'type': 'warehouse'}, context=context) + else: + new_id = super(Location, self).copy( + cursor, user, location.id, default=default, context=context) + warehouse_locations = context.get('cp_warehouse_locations', {}) + if location.id in warehouse_locations.values(): + for field, loc_id in warehouse_locations.iteritems(): + if loc_id == location.id: + self.write( + cursor, user, context['cp_warehouse_id'], + {field: new_id}, context=context) + + res.append(new_id) + + return int_id and res[0] or res Location() From 9c899bc567dcd56d859e3ad134fa54871732f023 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Tue, 26 May 2009 16:23:20 +0200 Subject: [PATCH 03/52] Added constraint on default uom on product. Fix issue1063. --- product.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/product.py b/product.py index 8eb3821430..527f76cffd 100644 --- a/product.py +++ b/product.py @@ -23,6 +23,38 @@ class Template(ModelSQL, ModelView): res[template.id] += product[name] return res + def __init__(self): + super(Template, self).__init__() + self._error_messages.update({ + 'change_default_uom': 'You cannot change the default uom for '\ + 'a product which is associated to stock moves.', + }) + + def write(self, cursor, user, ids, vals, context=None): + move_obj = self.pool.get('stock.move') + if not vals.get("default_uom"): + return super(Template, self).write(cursor, user, ids, vals, + context=context) + + for i in range(0, len(ids), cursor.IN_MAX): + sub_ids = ids[i:i + cursor.IN_MAX] + res = self.search(cursor, user, [ + ('id', 'in', sub_ids), + ('default_uom', '!=', vals['default_uom']), + ], context=context) + + if res: + res = move_obj.search(cursor, user, [ + ('product.template', 'in', res), + ], limit=1, context=context) + if res: + self.raise_user_error(cursor, 'change_default_uom', + context=context) + + return super(Template, self).write(cursor, user, ids, vals, + context=context) + + Template() class Product(ModelSQL, ModelView): From 3dd6a0ff80a8b6711bcfa650d14518d55f55d5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 20 Jun 2009 14:26:01 +0200 Subject: [PATCH 04/52] Don't set date in set_state_done for issue1087 --- inventory.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/inventory.py b/inventory.py index c90188bdc6..5ce221f722 100644 --- a/inventory.py +++ b/inventory.py @@ -90,11 +90,9 @@ class Inventory(ModelWorkflow, ModelSQL, ModelView): for line in inventory.lines: line_obj.create_move(cursor, user, line, context=context) - self.write( - cursor, user, inventory_id, - {'state': 'done', - 'date': date_obj.today(cursor, user, context=context)}, - context=context) + self.write(cursor, user, inventory_id, { + 'state': 'done', + }, context=context) def copy(self, cursor, user, ids, default=None, context=None): date_obj = self.pool.get('ir.date') From b1f39fe2230bd639160fe69a1c6b905d9b5b88ac Mon Sep 17 00:00:00 2001 From: Korbinian Preisler Date: Sat, 20 Jun 2009 14:31:36 +0200 Subject: [PATCH 05/52] Fix effective_date of stock move from inventory for issue 1087 --- inventory.py | 1 + 1 file changed, 1 insertion(+) diff --git a/inventory.py b/inventory.py index 5ce221f722..5b8e6e622f 100644 --- a/inventory.py +++ b/inventory.py @@ -296,6 +296,7 @@ class InventoryLine(ModelSQL, ModelView): 'uom': line.uom.id, 'company': line.inventory.company.id, 'state': 'done', + 'effective_date': line.inventory.date, }, context=context) self.write(cursor, user, line.id, {'move': move_id}, context=context) From 49d512070f6aa543ef587cf8b5f130b82e991fb5 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Fri, 26 Jun 2009 00:28:16 +0200 Subject: [PATCH 06/52] Update doc to reflect packing>shipment renaming --- doc/index.rst | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index ddb4277e2c..5932beb636 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -2,8 +2,8 @@ Stock Module ############ The stock module define fundamentals for all stock management -situations: Locations where product are stored, move between these -locations, packings for product arrivals and departures and inventory +situations: Locations where product are stored, moves between these +locations, shipments for product arrivals and departures and inventory to control and update stock levels. Location @@ -91,17 +91,17 @@ Assigned move with a planned date greater than today and smaller than the given date are also summed. -Packing -******* +Shipment +******** -A Packing define a group of moves happening at the same date and +A Shipment define a group of moves happening at the same date and around the same location. -Supplier Packing -++++++++++++++++ +Supplier Shipment ++++++++++++++++++ -A supplier packing is used when products are received from a +A supplier shipment is used when products are received from a supplier. It is mainly composed of a party (the supplier), a location (the warehouse in which the products are coming) and two list of moves: @@ -116,7 +116,7 @@ supplier. It is mainly composed of a party (the supplier), a location location (or one of his child locations). -The supplier packing can be in one of this states: +The supplier shipment can be in one of this states: * Draft @@ -129,17 +129,17 @@ The supplier packing can be in one of this states: * Done - Inventory moves are in state Done. + Inventory and incoming moves are in state Done. * Cancel All moves are cancelled. -Customer Packing -++++++++++++++++ +Customer Shipment ++++++++++++++++++ -A customer packing is used for sending products to customer. It is +A customer shipment is used for sending products to customer. It is mainly composed of a party (the customer), a location (the warehouse out of which the product are going) and two list of moves: @@ -154,7 +154,7 @@ out of which the product are going) and two list of moves: customer location. -The customer packing can be in one of this states: +The customer shipment can be in one of this states: * Draft @@ -162,9 +162,9 @@ The customer packing can be in one of this states: * Waiting - When a customer packing is set to waiting, the inventory moves are + When a customer shipment is set to waiting, the inventory moves are created (or completed) to balance the outgoing moves. The waiting - state also means that the packing should be processed. + state also means that the shipment should be processed. * Assigned @@ -179,19 +179,19 @@ The customer packing can be in one of this states: * Done - The packing is Done when the outgoing moves have been made, + The shipment is Done when the outgoing moves have been made, e.g. when a truck left the warehouse. * Cancel - A packing which is not yet completed (not in state Done) can be + A shipment which is not yet completed (not in state Done) can be cancelled at any time. This also cancel all the moves. -Internal Packing -++++++++++++++++ +Internal Shipment ++++++++++++++++++ -A customer packing is used for sending products across locations +An internal shipment is used for sending products across locations inside the company. It is mainly composed of two locations and a list of moves. It can be in one of these states: @@ -202,7 +202,7 @@ of moves. It can be in one of these states: * Waiting - The waiting state means that the packing should be processed. + The waiting state means that the shipment should be processed. * Assigned @@ -210,11 +210,11 @@ of moves. It can be in one of these states: * Done - The packing is Done when the moves have been made. + The shipment is Done when the moves have been made. * Cancel - A packing which is not yet completed (not in state Done) can be + A shipment which is not yet completed (not in state Done) can be cancelled at any time. This also cancel all the moves. From e5f533b32a652519787251527aa367b89868972a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 7 Jul 2009 11:19:09 +0200 Subject: [PATCH 07/52] Increase version number --- __tryton__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tryton__.py b/__tryton__.py index f2b8f02d3c..a9b88232f1 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -6,7 +6,7 @@ 'name_es_CO': 'Inventarios', 'name_es_ES': 'Inventarios', 'name_fr_FR': 'Gestion des stocks', - 'version': '1.2.0', + 'version': '1.2.1', 'author': 'B2CK', 'email': 'info@b2ck.com', 'website': 'http://www.tryton.org/', From dda0968b28ca30825d18d7219881e78ffef428d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 7 Jul 2009 11:19:37 +0200 Subject: [PATCH 08/52] Prepare changelog for release 1.2.1 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index d340420665..46986a8213 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.2.1 - 2009-07-07 +* Some bug fixes (see mercurial logs for details) + Version 1.2.0 - 2009-04-20 * Bug fixes (see mercurial logs for details) * Added return packings and a wizard to create customer return packing. From 60c0d8380c4247bfa8a6fa33670ecfb9b2828758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 7 Jul 2009 11:19:41 +0200 Subject: [PATCH 09/52] Added tag 1.2.1 for changeset ef6f8acc4384 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index e2e684661a..bffae98431 100644 --- a/.hgtags +++ b/.hgtags @@ -1,2 +1,3 @@ 36cc8c10a10e0df5e7a0ef2cb6d6cdda706c0180 1.0.0 f1d720635a60692c9abeb972734482e01ebc4b87 1.2.0 +ef6f8acc43847adeed8b37ce91a8d3170dff5388 1.2.1 From dbf4fe57b23c3ede8cda2cd6c3038142573c8e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 7 Jul 2009 11:20:06 +0200 Subject: [PATCH 10/52] Increase version number --- __tryton__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tryton__.py b/__tryton__.py index a9b88232f1..9bcf8f7b67 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -6,7 +6,7 @@ 'name_es_CO': 'Inventarios', 'name_es_ES': 'Inventarios', 'name_fr_FR': 'Gestion des stocks', - 'version': '1.2.1', + 'version': '1.2.2', 'author': 'B2CK', 'email': 'info@b2ck.com', 'website': 'http://www.tryton.org/', From 1a6b3b64adbfb551d26f923644f25aabfa6a73c2 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Thu, 9 Jul 2009 17:51:34 +0200 Subject: [PATCH 11/52] Typo + comments about product type and cost price method --- doc/index.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 5932beb636..0dc64a6244 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -49,11 +49,15 @@ Move **** A move is a movement of a product in a given quantity between two -locations. It may eventually define a unit price and a currency for +locations. It may eventually defines a unit price and a currency for the products that are moved from or to another company, allowing to -compute stock value at any time. A move also define a planned date -(when one plan to do the move) and an effective date (when the move is -actually made). +compute stock value at any time (and to update the cost prices if the +choosen cost price method is *Average*). A move also defines a planned +date (when one plan to do the move) and an effective date (when the +move is actually made). Products that are used in stock move must of +of type *Stockable* or *Consumable*. Stock levels are ignored for +consumable, this means that they can be always assigned. *Service* +products are ignored by the stock module. A move can be in one of this states: From 347e1f4df8636107e6d08f3224c38f1921d85704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 27 Jul 2009 16:48:41 +0200 Subject: [PATCH 12/52] Remove version from INSTALL, it is in setup.py --- INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 92c33f6495..0c3a654103 100644 --- a/INSTALL +++ b/INSTALL @@ -5,7 +5,7 @@ Prerequisites ------------- * Python 2.4 or later (http://www.python.org/) - * trytond 0.0.x (http://www.tryton.org/) + * trytond (http://www.tryton.org/) * trytond_party (http://www.tryton.org/) * trytond_product (http://www.tryton.org/) * trytond_company (http://www.tryton.org/) From 5ba676929123c092a280845660e1b7117bbb85cd Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Wed, 29 Jul 2009 11:07:57 +0200 Subject: [PATCH 13/52] Typos --- doc/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 0dc64a6244..f014a5ad23 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,7 +1,7 @@ Stock Module ############ -The stock module define fundamentals for all stock management +The stock module defines fundamentals for all stock management situations: Locations where product are stored, moves between these locations, shipments for product arrivals and departures and inventory to control and update stock levels. @@ -9,8 +9,8 @@ to control and update stock levels. Location ******** -Location are generic places where products are physically or virtually -stored. There are six types of locations: +Locations are generic places where products are physically or +virtually stored. There are six types of locations: * Storage From 767fd830c016d6598a78e8f302ea3cf79942b4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 21 Sep 2009 10:47:38 +0200 Subject: [PATCH 14/52] Don't use global context as default value of act_window for issue1183 (transplanted from 6f0af488dd359668d01dfa8990066d3301287413) --- location.py | 10 +++++----- product.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/location.py b/location.py index e78de8d034..a474d5fd8d 100644 --- a/location.py +++ b/location.py @@ -349,13 +349,13 @@ class OpenProduct(Wizard): context=context) res = act_window_obj.read(cursor, user, model_data.db_id, context=context) - if context == None: context = {} - context['locations'] = data['ids'] + ctx = {} + ctx['locations'] = data['ids'] if data['form']['forecast_date']: - context['stock_date_end'] = data['form']['forecast_date'] + ctx['stock_date_end'] = data['form']['forecast_date'] else: - context['stock_date_end'] = datetime.date.max - res['context'] = str(context) + ctx['stock_date_end'] = datetime.date.max + res['context'] = str(ctx) return res diff --git a/product.py b/product.py index 527f76cffd..b239e8a359 100644 --- a/product.py +++ b/product.py @@ -561,13 +561,13 @@ class OpenLocation(Wizard): context=context) res = act_window_obj.read(cursor, user, model_data.db_id, context=context) - if context == None: context = {} - context['product'] = data['id'] + ctx = {} + ctx['product'] = data['id'] if data['form']['forecast_date']: - context['stock_date_end'] = data['form']['forecast_date'] + ctx['stock_date_end'] = data['form']['forecast_date'] else: - context['stock_date_end'] = datetime.date.max - res['context'] = str(context) + ctx['stock_date_end'] = datetime.date.max + res['context'] = str(ctx) return res From 7552b8009ae87085e513aac9685e322d24a0e309 Mon Sep 17 00:00:00 2001 From: Ian Wilson Date: Thu, 24 Sep 2009 23:58:33 -0700 Subject: [PATCH 15/52] Return dictionary when given no locations for issue1190. (transplanted from ce2a2525700133cba8b85f5c483147f3a8ccc21e) --- product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product.py b/product.py index b239e8a359..d1276c6e45 100644 --- a/product.py +++ b/product.py @@ -175,7 +175,7 @@ class Product(ModelSQL, ModelView): today = date_obj.today(cursor, user, context=context) if not location_ids: - return [] + return {} if context is None: context= {} # Skip warehouse location in favor of their storage location From 48eff49669aeb9b4fde851d4af97e095d00bfa20 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Tue, 29 Sep 2009 12:14:07 +0200 Subject: [PATCH 16/52] Use local context instead of editing global one (transplanted from efd54bea6af8b7f6cce82bcdeced7a64c2fb36eb) --- inventory.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inventory.py b/inventory.py index 5b8e6e622f..0f21dedd79 100644 --- a/inventory.py +++ b/inventory.py @@ -151,10 +151,11 @@ class Inventory(ModelWorkflow, ModelSQL, ModelView): for inventory in inventories: # Compute product quantities - context['stock_date_end'] = inventory.date + ctx = context and context.copy() or {} + ctx['stock_date_end'] = inventory.date pbl = product_obj.products_by_location( cursor, user, [inventory.location.id], - product_ids=product_ids, context=context) + product_ids=product_ids, context=ctx) # Index some data product2uom = {} From aa96e70673d947ac330861e9360c2c3b821a4a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 27 Oct 2009 10:17:57 +0100 Subject: [PATCH 17/52] Test stock_date_end in context before comparing with today (transplanted from 25baf0c9daa6d35033b21ff41311384b43179833) --- product.py | 1 + 1 file changed, 1 insertion(+) diff --git a/product.py b/product.py index d1276c6e45..76f78de60a 100644 --- a/product.py +++ b/product.py @@ -72,6 +72,7 @@ class Product(ModelSQL, ModelView): return dict([(id, 0.0) for id in ids]) if name == 'quantity' and \ + context.get('stock_date_end') and \ context.get('stock_date_end') > \ date_obj.today(cursor, user, context=context): From aa6c4219c5333a2f4a3c42b616c28d23ae16a02a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 27 Oct 2009 10:19:07 +0100 Subject: [PATCH 18/52] Fix search_quantity to compute product_by_location like get_quantity (transplanted from 21e928e05ca37a6ce97164d0933463fa26922e40) --- product.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/product.py b/product.py index 76f78de60a..b2a3980fd0 100644 --- a/product.py +++ b/product.py @@ -113,15 +113,21 @@ class Product(ModelSQL, ModelView): if not (context and context.get('locations') and domain): return [] - if (name != 'forecast_quantity') and context.get('stock_date_end'): - if context['stock_date_end'] != date_obj.today(cursor, user, - context=context): - context = context.copy() - del context['stock_date_end'] - if name == 'forecast_quantity' and not context.get('stock_date_end'): + if name == 'quantity' and \ + context.get('stock_date_end') and \ + context.get('stock_date_end') > \ + date_obj.today(cursor, user, context=context): + context = context.copy() - context['stock_date_end'] = datetime.date.max + context['stock_date_end'] = date_obj.today( + cursor, user, context=context) + + if name == 'forecast_quantity': + context = context.copy() + context['forecast'] = True + if not context.get('stock_date_end'): + context['stock_date_end'] = datetime.date.max pbl = self.products_by_location( cursor, user, location_ids=context['locations'], with_childs=True, From 825d21c086d37ee5b6c7e25be5b9f47f3c9601ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 28 Oct 2009 09:15:20 +0100 Subject: [PATCH 19/52] Set planned date on inventory moves of shipments for issue1259 (transplanted from de0012795f472c56e5f5484f8c4deec1e1b6c093) --- packing.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packing.py b/packing.py index 193e79e109..d1473046c5 100644 --- a/packing.py +++ b/packing.py @@ -272,6 +272,9 @@ class PackingIn(ModelWorkflow, ModelSQL, ModelView): res['to_location'] = incoming_move.packing_in.warehouse.\ storage_location.id res['state'] = 'draft' + # Product will be considered in stock only when the inventory + # move will be made: + res['planned_date'] = False res['company'] = incoming_move.company.id return res @@ -707,6 +710,7 @@ class PackingOut(ModelWorkflow, ModelSQL, ModelView): 'quantity': out_quantity, 'packing_out': packing.id, 'state': 'draft', + 'planned_date': shipment.planned_date, 'company': move.company.id, 'currency': move.company.currency.id, 'unit_price': unit_price, @@ -779,6 +783,7 @@ class PackingOut(ModelWorkflow, ModelSQL, ModelView): 'uom': move.uom.id, 'quantity': move.quantity, 'packing_out': packing.id, + 'planned_date': move.planned_date, 'state': 'draft', 'company': move.company.id, }, context=context) @@ -1096,6 +1101,9 @@ class PackingOutReturn(ModelWorkflow, ModelSQL, ModelView): res['to_location'] = incoming_move.packing_out_return.warehouse.\ storage_location.id res['state'] = 'draft' + # Product will be considered in stock only when the inventory + # move will be made: + res['planned_date'] = False res['company'] = incoming_move.company.id return res From 30b99a5db337428ec475c5f8413c8a834c7c60fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 28 Oct 2009 09:17:16 +0100 Subject: [PATCH 20/52] Use stock_assign to compute product by location with future date (transplanted from c934d6713653bd9a46ba1c1d566a172b9f055ccc) --- product.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/product.py b/product.py index b2a3980fd0..45817ef415 100644 --- a/product.py +++ b/product.py @@ -278,7 +278,8 @@ class Product(ModelSQL, ModelView): ')' state_date_vals = [ - 'done', 'assigned', today, today, + 'done', context.get('stock_assign') and 'assigned' or 'done', + today, today, 'done', 'assigned', 'draft', context['stock_date_end'], today, context['stock_date_end'], today, From 523a5070e906787b87c52a3aa0373c6b3ef1add9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 28 Oct 2009 09:18:00 +0100 Subject: [PATCH 21/52] Compute infinite date end like a future date for issue1259 (transplanted from 2e24870d23762982a4ee045671c371bdd37f0d1a) --- product.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/product.py b/product.py index 45817ef415..720fb9a529 100644 --- a/product.py +++ b/product.py @@ -232,10 +232,6 @@ class Product(ModelSQL, ModelView): context['stock_date_end'], context['stock_date_end'], ] - # infinite date end: take all states for the moves - elif context['stock_date_end'] == datetime.date.max: - state_date_clause = 'state in (%s, %s, %s)' - state_date_vals = ['done', 'assigned', 'draft'] # future date end: filter move on state done and date # before today, or on all state and date between today and # date_end. From c7fefbad118e7e3d76a68af4eaefba1b2ab2d2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 2 Nov 2009 19:18:01 +0100 Subject: [PATCH 22/52] Fix company context domain when company is not in context (transplanted from b83a1a1f2351497e8dff7f5439b8e31fe3ed7184) --- move.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/move.py b/move.py index f1dd31e879..35f2435e7e 100644 --- a/move.py +++ b/move.py @@ -61,7 +61,8 @@ class Move(ModelSQL, ModelView): company = fields.Many2One('company.company', 'Company', required=True, states={ 'readonly': "state != 'draft'", - }, domain="[('id', '=', context.get('company', 0))]") + }, domain="[('id', 'company' in context and '=' or '!=', " \ + "context.get('company', 0))]") unit_price = fields.Numeric('Unit Price', digits=(16, 4), states={ 'invisible': "not unit_price_required", From 645f872a5e63f633ec15526952b517557100e662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 24 Nov 2009 18:15:30 +0100 Subject: [PATCH 23/52] Prepare release 1.2.2 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 46986a8213..865d0e6f2f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.2.2 - 2009-11-24 +* Some bug fixes (see mercurial logs for details) + Version 1.2.1 - 2009-07-07 * Some bug fixes (see mercurial logs for details) From dfbf745bcb3890919252d4ebf03833f5d22a1be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 24 Nov 2009 18:15:34 +0100 Subject: [PATCH 24/52] Added tag 1.2.2 for changeset 6c5e47423783 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index bffae98431..8338a53210 100644 --- a/.hgtags +++ b/.hgtags @@ -1,3 +1,4 @@ 36cc8c10a10e0df5e7a0ef2cb6d6cdda706c0180 1.0.0 f1d720635a60692c9abeb972734482e01ebc4b87 1.2.0 ef6f8acc43847adeed8b37ce91a8d3170dff5388 1.2.1 +6c5e47423783b85d47dc836dabe0161b36c41acd 1.2.2 From df33a96a2b51a42664b920bd9929d83327886a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 24 Nov 2009 18:17:17 +0100 Subject: [PATCH 25/52] Increase version number --- __tryton__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tryton__.py b/__tryton__.py index 9bcf8f7b67..d5bc49b53a 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -6,7 +6,7 @@ 'name_es_CO': 'Inventarios', 'name_es_ES': 'Inventarios', 'name_fr_FR': 'Gestion des stocks', - 'version': '1.2.2', + 'version': '1.2.3', 'author': 'B2CK', 'email': 'info@b2ck.com', 'website': 'http://www.tryton.org/', From 94de87819fa1ab745ab06946186374f9e251e5a4 Mon Sep 17 00:00:00 2001 From: Bertrand Chenal Date: Mon, 7 Dec 2009 10:18:06 +0100 Subject: [PATCH 26/52] Removed duplicate set_state_cancel on inventory (issue1323) (transplanted from 10dfa28e1cbe76b7a5f0bf11920ecc2243fecd49) --- inventory.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/inventory.py b/inventory.py index 0f21dedd79..7296c3d4f0 100644 --- a/inventory.py +++ b/inventory.py @@ -65,11 +65,6 @@ class Inventory(ModelWorkflow, ModelSQL, ModelView): return location_ids[0] return False - def set_state_cancel(self, cursor, user, ids, context=None): - self.write(cursor, user, ids, { - 'state': 'cancel', - }, context=context) - def set_state_draft(self, cursor, user, inventory_id, context=None): self.write(cursor, user, inventory_id, { 'state': 'draft', From 2e215cbe6ad4e04bfa7510921e899c289e4a3cbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 18 Jan 2010 23:15:50 +0100 Subject: [PATCH 27/52] Fix add action in set_*_moves functions for issue1379 The add value can be a list of ids or an id (transplanted from 99ff6cb91f5543151f7a86228fed4eae29f0ec21) --- packing.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/packing.py b/packing.py index d1473046c5..c1da75747c 100644 --- a/packing.py +++ b/packing.py @@ -132,7 +132,10 @@ class PackingIn(ModelWorkflow, ModelSQL, ModelView): self.raise_user_error(cursor, 'incoming_move_input_dest', context=context) elif act[0] == 'add': - move_ids.append(act[1]) + if isinstance(act[1], (int, long)): + move_ids.append(act[1]) + else: + move_ids.extend(act[1]) elif act[0] == 'set': move_ids.extend(act[1]) @@ -179,7 +182,10 @@ class PackingIn(ModelWorkflow, ModelSQL, ModelView): self.raise_user_error(cursor, 'inventory_move_input_source', context=context) elif act[0] == 'add': - move_ids.append(act[1]) + if isinstance(act[1], (int, long)): + move_ids.append(act[1]) + else: + move_ids.extend(act[1]) elif act[0] == 'set': move_ids.extend(act[1]) @@ -570,7 +576,10 @@ class PackingOut(ModelWorkflow, ModelSQL, ModelView): self.raise_user_error(cursor, 'outgoing_move_output_source', context=context) elif act[0] == 'add': - move_ids.append(act[1]) + if isinstance(act[1], (int, long)): + move_ids.append(act[1]) + else: + move_ids.extend(act[1]) elif act[0] == 'set': move_ids.extend(act[1]) @@ -617,7 +626,10 @@ class PackingOut(ModelWorkflow, ModelSQL, ModelView): self.raise_user_error(cursor, 'inventory_move_output_dest', context=context) elif act[0] == 'add': - move_ids.append(act[1]) + if isinstance(act[1], (int, long)): + move_ids.append(act[1]) + else: + move_ids.extend(act[1]) elif act[0] == 'set': move_ids.extend(act[1]) @@ -960,7 +972,10 @@ class PackingOutReturn(ModelWorkflow, ModelSQL, ModelView): self.raise_user_error(cursor, 'incoming_move_input_dest', context=context) elif act[0] == 'add': - move_ids.append(act[1]) + if isinstance(act[1], (int, long)): + move_ids.append(act[1]) + else: + move_ids.extend(act[1]) elif act[0] == 'set': move_ids.extend(act[1]) @@ -1007,7 +1022,10 @@ class PackingOutReturn(ModelWorkflow, ModelSQL, ModelView): self.raise_user_error(cursor, 'inventory_move_input_source', context=context) elif act[0] == 'add': - move_ids.append(act[1]) + if isinstance(act[1], (int, long)): + move_ids.append(act[1]) + else: + move_ids.extend(act[1]) elif act[0] == 'set': move_ids.extend(act[1]) From ff5c558f2e60fbdaf990559c2b12549fdfbf73ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 19 Jan 2010 14:12:13 +0100 Subject: [PATCH 28/52] Fix test on to_location_warehouse for XML-RPC for issue1380 Tuple in XML-RPC are list (transplanted from 5522087017922d66c30097f6000a484559395abe) --- move.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/move.py b/move.py index 35f2435e7e..5eeed7478f 100644 --- a/move.py +++ b/move.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. "Move" -from trytond.model import ModelView, ModelSQL, fields +from trytond.model import ModelView, ModelSQL, fields, OPERATORS from trytond.backend import TableHandler from decimal import Decimal import datetime @@ -381,10 +381,11 @@ class Move(ModelSQL, ModelView): def process_args(args): i = 0 while i < len(args): - if isinstance(args[i], list): - process_args(args[i]) - if isinstance(args[i], tuple) \ - and args[i][0] == 'to_location_warehouse': + #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(cursor, user, @@ -392,6 +393,8 @@ class Move(ModelSQL, ModelView): 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(cursor, user, args, offset=offset, From 2e92c73e6d93fb5077c8440732ec46a8a85ecbba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 25 Jan 2010 09:46:42 +0100 Subject: [PATCH 29/52] Update COPYRIGHT --- COPYRIGHT | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index da277a9b35..94a43fbe61 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,7 +1,7 @@ Copyright (C) 2004-2008 Tiny SPRL. -Copyright (C) 2008-2009 Cédric Krier. -Copyright (C) 2008-2009 Bertrand Chenal. -Copyright (C) 2008-2009 B2CK SPRL. +Copyright (C) 2008-2010 Cédric Krier. +Copyright (C) 2008-2010 Bertrand Chenal. +Copyright (C) 2008-2010 B2CK SPRL. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by From f69c995969ed5a0252b3e1057cba0aa27c25f006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 18 Feb 2010 20:25:13 +0100 Subject: [PATCH 30/52] Prepare release 1.2.3 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 865d0e6f2f..1ce5d6197d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.2.3 - 2010-02-18 +* Some bug fixes (see mercurial logs for details) + Version 1.2.2 - 2009-11-24 * Some bug fixes (see mercurial logs for details) From 80ba8d14632affd176640e374d5d62cb5f8be0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 18 Feb 2010 20:25:17 +0100 Subject: [PATCH 31/52] Added tag 1.2.3 for changeset 5fb1520d8d9b --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 8338a53210..f0dcd1af23 100644 --- a/.hgtags +++ b/.hgtags @@ -2,3 +2,4 @@ f1d720635a60692c9abeb972734482e01ebc4b87 1.2.0 ef6f8acc43847adeed8b37ce91a8d3170dff5388 1.2.1 6c5e47423783b85d47dc836dabe0161b36c41acd 1.2.2 +5fb1520d8d9b7d7ddfd6b7b82f88ef649503c38e 1.2.3 From 9b153185dc59cb97dbbf637e693ebb68bd58bf72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 18 Feb 2010 20:26:49 +0100 Subject: [PATCH 32/52] Increase version number --- __tryton__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tryton__.py b/__tryton__.py index d5bc49b53a..386507efb1 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -6,7 +6,7 @@ 'name_es_CO': 'Inventarios', 'name_es_ES': 'Inventarios', 'name_fr_FR': 'Gestion des stocks', - 'version': '1.2.3', + 'version': '1.2.4', 'author': 'B2CK', 'email': 'info@b2ck.com', 'website': 'http://www.tryton.org/', From eae3444c6daa8fdc3f34829a67ea4fbd22b7c43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 11 May 2010 22:19:43 +0200 Subject: [PATCH 33/52] Don't include .pyc from tests (transplanted from d9de8be4d0a23c72a3bc84cd1043554043ebc8bc) --- MANIFEST.in | 1 - 1 file changed, 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index b2a140eeeb..dcb2afa6dc 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,5 +7,4 @@ include LICENSE include *.xml include *.odt include *.csv -include tests/* include doc/* From 1347b0e38a95d73f7797947a8b928f8e1404fe3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 31 Aug 2010 19:11:48 +0200 Subject: [PATCH 34/52] Use safe_eval instead of eval for issue1640 (transplanted from b0760a09a50cdc3ab501ad3a710852d671ebfe30) --- product.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/product.py b/product.py index 720fb9a529..d743832f91 100644 --- a/product.py +++ b/product.py @@ -3,6 +3,7 @@ from trytond.model import ModelView, ModelSQL, fields from trytond.wizard import Wizard import datetime +from trytond.tools import safe_eval class Template(ModelSQL, ModelView): @@ -105,7 +106,7 @@ class Product(ModelSQL, ModelView): return False if operator == "=": operator= "==" - res = res and (eval(str(value) + operator + str(operand))) + res = res and (safe_eval(str(value) + operator + str(operand))) return res def search_quantity(self, cursor, user, name, domain=None, context=None): From 7fbbb5c9138de491a42460a05785ce12e51c3348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 31 Aug 2010 20:34:07 +0200 Subject: [PATCH 35/52] Prepare release 1.2.4 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 1ce5d6197d..a0e314381a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.2.4 - 2010-08-31 +* Security fix to use safe_eval instead of eval + Version 1.2.3 - 2010-02-18 * Some bug fixes (see mercurial logs for details) From 468f39e24e63050de63238ad0c5f9f063fef6b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 31 Aug 2010 20:34:12 +0200 Subject: [PATCH 36/52] Added tag 1.2.4 for changeset 999045b21fcd --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index f0dcd1af23..64c8bd35a9 100644 --- a/.hgtags +++ b/.hgtags @@ -3,3 +3,4 @@ f1d720635a60692c9abeb972734482e01ebc4b87 1.2.0 ef6f8acc43847adeed8b37ce91a8d3170dff5388 1.2.1 6c5e47423783b85d47dc836dabe0161b36c41acd 1.2.2 5fb1520d8d9b7d7ddfd6b7b82f88ef649503c38e 1.2.3 +999045b21fcdf8c6b972a1f2f869d6d53f76e9b1 1.2.4 From ce3b70ae3a83e9b87b9ec0004f443b8f86851b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 31 Aug 2010 20:44:46 +0200 Subject: [PATCH 37/52] Increase version number --- __tryton__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tryton__.py b/__tryton__.py index 386507efb1..48291bff1e 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -6,7 +6,7 @@ 'name_es_CO': 'Inventarios', 'name_es_ES': 'Inventarios', 'name_fr_FR': 'Gestion des stocks', - 'version': '1.2.4', + 'version': '1.2.5', 'author': 'B2CK', 'email': 'info@b2ck.com', 'website': 'http://www.tryton.org/', From 8acd28d7addd7be0c7ce21337ec342ef92e99c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 1 Sep 2010 07:43:43 +0200 Subject: [PATCH 38/52] Backed out changeset 513015815c8c --- product.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/product.py b/product.py index d743832f91..720fb9a529 100644 --- a/product.py +++ b/product.py @@ -3,7 +3,6 @@ from trytond.model import ModelView, ModelSQL, fields from trytond.wizard import Wizard import datetime -from trytond.tools import safe_eval class Template(ModelSQL, ModelView): @@ -106,7 +105,7 @@ class Product(ModelSQL, ModelView): return False if operator == "=": operator= "==" - res = res and (safe_eval(str(value) + operator + str(operand))) + res = res and (eval(str(value) + operator + str(operand))) return res def search_quantity(self, cursor, user, name, domain=None, context=None): From e2f273777a199cc5f8ce7dce81d2354ffd63e9ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 1 Sep 2010 07:46:38 +0200 Subject: [PATCH 39/52] Prepare release 1.2.5 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index a0e314381a..f1f651b90a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.2.5 - 2010-09-01 +* Some bug fixes (see mercurial logs for details) + Version 1.2.4 - 2010-08-31 * Security fix to use safe_eval instead of eval From 04938a4645b05f996cad8c2fd05aac941941f2de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 1 Sep 2010 07:46:44 +0200 Subject: [PATCH 40/52] Added tag 1.2.5 for changeset bfaa898c39ec --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 64c8bd35a9..8dc3ad3291 100644 --- a/.hgtags +++ b/.hgtags @@ -4,3 +4,4 @@ ef6f8acc43847adeed8b37ce91a8d3170dff5388 1.2.1 6c5e47423783b85d47dc836dabe0161b36c41acd 1.2.2 5fb1520d8d9b7d7ddfd6b7b82f88ef649503c38e 1.2.3 999045b21fcdf8c6b972a1f2f869d6d53f76e9b1 1.2.4 +bfaa898c39ec63f35015133bb2d722f43ab17c36 1.2.5 From 72e2722e7c379215d1981626004118813d3eb6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 1 Sep 2010 07:47:38 +0200 Subject: [PATCH 41/52] Increase version number --- __tryton__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tryton__.py b/__tryton__.py index 48291bff1e..8f0be62684 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -6,7 +6,7 @@ 'name_es_CO': 'Inventarios', 'name_es_ES': 'Inventarios', 'name_fr_FR': 'Gestion des stocks', - 'version': '1.2.5', + 'version': '1.2.6', 'author': 'B2CK', 'email': 'info@b2ck.com', 'website': 'http://www.tryton.org/', From 94d27f34cc5766fcb67a319a8b44b849a3d6a058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 19 Sep 2010 18:39:29 +0200 Subject: [PATCH 42/52] Add missing super call in Product and Location to view_header_get for issue1695 (transplanted from f6edadcd6e752f47cbb8bff62b4c5e3196520354) --- location.py | 2 ++ product.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/location.py b/location.py index a474d5fd8d..0d0e7d9047 100644 --- a/location.py +++ b/location.py @@ -171,6 +171,8 @@ class Location(ModelSQL, ModelView): product_obj = self.pool.get('product.product') if context is None: context = {} + value = super(Location, self).view_header_get(cursor, user, value, + view_type=view_type, context=context) ctx = context.copy() ctx['active_test'] = False if context.get('product') \ diff --git a/product.py b/product.py index 720fb9a529..836701932d 100644 --- a/product.py +++ b/product.py @@ -504,6 +504,10 @@ class Product(ModelSQL, ModelView): def view_header_get(self, cursor, user, value, view_type='form', context=None): + if context is None: + context = {} + value = super(Product, self).view_header_get(cursor, user, value, + view_type=view_type, context=context) if not context.get('locations'): return value location_obj = self.pool.get('stock.location') From dbc09db8008352ef20e6a8729410a61fdbf29cca Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Tue, 2 Nov 2010 21:11:58 +0100 Subject: [PATCH 43/52] Prepare release 1.2.6 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index f1f651b90a..64b80ae34f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.2.6 - 2010-11-02 +* Bug fixes (see mercurial logs for details) + Version 1.2.5 - 2010-09-01 * Some bug fixes (see mercurial logs for details) From c2dc459d69aa1b0a622f035c053d330bf01c371d Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Tue, 2 Nov 2010 21:11:58 +0100 Subject: [PATCH 44/52] Added tag 1.2.6 for changeset 2334d2b63e2f --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 8dc3ad3291..37ea1771d9 100644 --- a/.hgtags +++ b/.hgtags @@ -5,3 +5,4 @@ ef6f8acc43847adeed8b37ce91a8d3170dff5388 1.2.1 5fb1520d8d9b7d7ddfd6b7b82f88ef649503c38e 1.2.3 999045b21fcdf8c6b972a1f2f869d6d53f76e9b1 1.2.4 bfaa898c39ec63f35015133bb2d722f43ab17c36 1.2.5 +2334d2b63e2f3c2c074873067cfeb57cf5baf0eb 1.2.6 From b1b78518ecc2af29ff750005bb6d778303f5c7d7 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Tue, 2 Nov 2010 21:11:59 +0100 Subject: [PATCH 45/52] Increase version number --- __tryton__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tryton__.py b/__tryton__.py index 8f0be62684..078fa5885e 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -6,7 +6,7 @@ 'name_es_CO': 'Inventarios', 'name_es_ES': 'Inventarios', 'name_fr_FR': 'Gestion des stocks', - 'version': '1.2.6', + 'version': '1.2.7', 'author': 'B2CK', 'email': 'info@b2ck.com', 'website': 'http://www.tryton.org/', From 0eb33b264501950f46ff7f603c89f135559787d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 10 May 2011 15:03:54 +0200 Subject: [PATCH 46/52] Add missing rounding in creation of move of inventory for issue2007 (transplanted from 340658d14f23ab0baa35ca6e28ddf5c902f6cc0a) --- inventory.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inventory.py b/inventory.py index 7296c3d4f0..ecdf4e5fd8 100644 --- a/inventory.py +++ b/inventory.py @@ -275,7 +275,11 @@ class InventoryLine(ModelSQL, ModelView): def create_move(self, cursor, user, line, context=None): move_obj = self.pool.get('stock.move') - delta_qty = line.expected_quantity - line.quantity + uom_obj = self.pool.get('product.uom') + + delta_qty = uom_obj.compute_qty(line.uom, + line.expected_quantity - line.quantity, + line.uom) if delta_qty == 0.0: return from_location = line.inventory.location.id From 1057a559a20f2a3e0f7a2c02b5b4194eb9b2d7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 16 May 2011 11:42:52 +0200 Subject: [PATCH 47/52] Add missing cursor, user and context --- inventory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inventory.py b/inventory.py index ecdf4e5fd8..57e0f06459 100644 --- a/inventory.py +++ b/inventory.py @@ -277,9 +277,9 @@ class InventoryLine(ModelSQL, ModelView): move_obj = self.pool.get('stock.move') uom_obj = self.pool.get('product.uom') - delta_qty = uom_obj.compute_qty(line.uom, + delta_qty = uom_obj.compute_qty(cursor, user, line.uom, line.expected_quantity - line.quantity, - line.uom) + line.uom, context=context) if delta_qty == 0.0: return from_location = line.inventory.location.id From 3ccbfcc3e52728a87e0539c3f503669f02d5693d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 10 May 2011 15:19:22 +0200 Subject: [PATCH 48/52] Missing currency and unit_price when creating inventory move on outgoing shipment (transplanted from 0376c1fec5ea1ca73e615e128200e4f98f0e5b57) --- packing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packing.py b/packing.py index c1da75747c..8d57a98b02 100644 --- a/packing.py +++ b/packing.py @@ -798,6 +798,8 @@ class PackingOut(ModelWorkflow, ModelSQL, ModelView): 'planned_date': move.planned_date, 'state': 'draft', 'company': move.company.id, + 'currency': move.currency.id, + 'unit_price': move.unit_price, }, context=context) def create(self, cursor, user, values, context=None): From 610952e9a40c93c68deab0f833d4765d583f18b6 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sun, 29 May 2011 13:13:02 +0200 Subject: [PATCH 49/52] Update COPYRIGHT --- COPYRIGHT | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index 94a43fbe61..97eff54014 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,7 +1,7 @@ Copyright (C) 2004-2008 Tiny SPRL. -Copyright (C) 2008-2010 Cédric Krier. -Copyright (C) 2008-2010 Bertrand Chenal. -Copyright (C) 2008-2010 B2CK SPRL. +Copyright (C) 2008-2011 Cédric Krier. +Copyright (C) 2008-2011 Bertrand Chenal. +Copyright (C) 2008-2011 B2CK SPRL. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by From aa8e34fdf9a79bf0946a878a32def185e89f9794 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sun, 29 May 2011 14:15:10 +0200 Subject: [PATCH 50/52] Prepare release 1.2.7 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 64b80ae34f..209b222abd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +Version 1.2.7 - 2011-05-29 +* Bug fixes (see mercurial logs for details) + Version 1.2.6 - 2010-11-02 * Bug fixes (see mercurial logs for details) From b00795a21c2f0e93e8f12515f6275e937e2e2d89 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sun, 29 May 2011 14:15:10 +0200 Subject: [PATCH 51/52] Added tag 1.2.7 for changeset 2b22ab72c063 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 37ea1771d9..dac4453841 100644 --- a/.hgtags +++ b/.hgtags @@ -6,3 +6,4 @@ ef6f8acc43847adeed8b37ce91a8d3170dff5388 1.2.1 999045b21fcdf8c6b972a1f2f869d6d53f76e9b1 1.2.4 bfaa898c39ec63f35015133bb2d722f43ab17c36 1.2.5 2334d2b63e2f3c2c074873067cfeb57cf5baf0eb 1.2.6 +2b22ab72c063137264ed08d40189480ad533c673 1.2.7 From ad7a4baeefe0cc0d16986e010f6c249007002e36 Mon Sep 17 00:00:00 2001 From: Mathias Behrle Date: Sun, 29 May 2011 14:15:17 +0200 Subject: [PATCH 52/52] Increase version number --- __tryton__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tryton__.py b/__tryton__.py index 078fa5885e..553c6cf64e 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -6,7 +6,7 @@ 'name_es_CO': 'Inventarios', 'name_es_ES': 'Inventarios', 'name_fr_FR': 'Gestion des stocks', - 'version': '1.2.7', + 'version': '1.2.8', 'author': 'B2CK', 'email': 'info@b2ck.com', 'website': 'http://www.tryton.org/',