From 02270bd0fde3e6ae4b49df19849d2686c671aad2 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 18 Nov 2014 16:27:16 +0100 Subject: [PATCH 1/3] [FIX] account: do not duplicate analytic lines on analytic journal duplicate --- addons/account/project/project.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/account/project/project.py b/addons/account/project/project.py index f4927331ca8..e67a03cafaa 100644 --- a/addons/account/project/project.py +++ b/addons/account/project/project.py @@ -38,6 +38,12 @@ class account_analytic_journal(osv.osv): 'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } + def copy_data(self, cr, uid, id, default=None, context=None): + if not default: + default = {} + default.update({'line_ids': False}) + return super(account_analytic_journal, self).copy_data(cr, uid, id, default, context) + account_analytic_journal() class account_journal(osv.osv): From bb7a9dea8b401f66ab6f4f241f21ecc4123b6b97 Mon Sep 17 00:00:00 2001 From: Frederic van der Essen Date: Tue, 18 Nov 2014 18:03:53 +0100 Subject: [PATCH 2/3] [FIX] point_of_sale: fix point of sale sequence declaration, github issue #3218 --- addons/point_of_sale/point_of_sale_sequence.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/point_of_sale_sequence.xml b/addons/point_of_sale/point_of_sale_sequence.xml index 4bcab244c56..607f2384439 100644 --- a/addons/point_of_sale/point_of_sale_sequence.xml +++ b/addons/point_of_sale/point_of_sale_sequence.xml @@ -36,7 +36,7 @@ POS Session pos.session - POS/%(day)s/(month)s/%(year)s/ + POS/%(day)s/%(month)s/%(year)s/ 4 From 529e920b2cc4673188dd209f91196a35dfdb7790 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 19 Nov 2014 13:24:32 +0100 Subject: [PATCH 3/3] [FIX] mrp: perform location chaining for kit exploded moves This rev. 7307227 ensured to not (re-)set the state 'confirmed' to exploded moves with a more advanced state (for instance, 'assigned') Nevertheless, the location chaining is performed on the move confirmation, through the action_confirm method of the stock.move model. Besides, the resulting moves of the _action_explode method had the state 'confirmed' on creation, the 'confirmed' state wasn't set by the method 'action_confirm', meaning that the moves were confirmed without having the location chaining done. Allowing moves to go through the action_confirm method even if the state was 'confirmed' or further triggered the location chaining. Preventing already confirmed moves to go through the action_confirm method prevented the location chaining, thus. We now create the resulting moves with the 'draft' state, and then confirm them through the procurement workflow signal 'button_confirm'. Thus, the resulting moves are confirmed by going through the action_confirm method, writing the confirmed state and triggering the location chaining at the same time. We then write the 'assigned' state if necessary. opw-617235 --- addons/mrp/stock.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index 51c237672a0..d049aea3803 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -56,9 +56,6 @@ class StockMove(osv.osv): factor = move.product_qty bom_point = bom_obj.browse(cr, uid, bis[0], context=context) res = bom_obj._bom_explode(cr, uid, bom_point, factor, []) - state = 'confirmed' - if move.state == 'assigned': - state = 'assigned' for line in res[0]: valdef = { 'picking_id': move.picking_id.id, @@ -68,7 +65,7 @@ class StockMove(osv.osv): 'product_uos': line['product_uos'], 'product_uos_qty': line['product_uos_qty'], 'move_dest_id': move.id, - 'state': state, + 'state': 'draft', #will be confirmed below 'name': line['name'], 'move_history_ids': [(6,0,[move.id])], 'move_history_ids2': [(6,0,[])], @@ -100,6 +97,9 @@ class StockMove(osv.osv): for m in procurement_obj.search(cr, uid, [('move_id','=',move.id)], context): wf_service.trg_validate(uid, 'procurement.order', m, 'button_confirm', cr) wf_service.trg_validate(uid, 'procurement.order', m, 'button_wait_done', cr) + if processed_ids and move.state == 'assigned': + # Set the state of resulting moves according to 'assigned' as the original move is assigned + move_obj.write(cr, uid, list(set(processed_ids) - set([move.id])), {'state': 'assigned'}, context=context) return processed_ids def action_consume(self, cr, uid, ids, product_qty, location_id=False, context=None):