Merge lp:~vauxoo/addons-vauxoo/addons-vauxoo-stock_picking_cancel_move-dev-julio into lp:addons-vauxoo

Proposed by Julio Serna-http://www.vauxoo.com
Status: Merged
Merged at revision: 494
Proposed branch: lp:~vauxoo/addons-vauxoo/addons-vauxoo-stock_picking_cancel_move-dev-julio
Merge into: lp:addons-vauxoo
Diff against target: 71 lines (+52/-1)
2 files modified
stock_picking_cancel/__openerp__.py (+1/-1)
stock_picking_cancel/stock.py (+51/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/addons-vauxoo-stock_picking_cancel_move-dev-julio
Reviewer Review Type Date Requested Status
Isaac López Zúñiga Pending
Moisés López - http://www.vauxoo.com Pending
Review via email: mp+127852@code.launchpad.net

Description of the change

cancel las polizas cuando cancelas picking o el move o la orden de produccion

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'stock_picking_cancel/__openerp__.py'
--- stock_picking_cancel/__openerp__.py 2012-08-07 18:37:02 +0000
+++ stock_picking_cancel/__openerp__.py 2012-10-03 19:08:24 +0000
@@ -31,7 +31,7 @@
31 "description" : """This module add a button to cancel after to done""",31 "description" : """This module add a button to cancel after to done""",
32 "website" : "http://www.vauxoo.com/",32 "website" : "http://www.vauxoo.com/",
33 "license" : "AGPL-3",33 "license" : "AGPL-3",
34 "depends" : ["stock",],34 "depends" : ["stock","account_relation_move"],
35 "init_xml" : [],35 "init_xml" : [],
36 "demo_xml" : [],36 "demo_xml" : [],
37 "update_xml" : [37 "update_xml" : [
3838
=== modified file 'stock_picking_cancel/stock.py'
--- stock_picking_cancel/stock.py 2012-08-07 18:37:02 +0000
+++ stock_picking_cancel/stock.py 2012-10-03 19:08:24 +0000
@@ -47,3 +47,54 @@
47 self.log(cr, uid, id, message)47 self.log(cr, uid, id, message)
48 return True48 return True
49stock_picking()49stock_picking()
50
51class stock_move(osv.osv):
52 _inherit = 'stock.move'
53
54 def action_cancel(self, cr, uid, ids, context=None):
55 account_move_line = self.pool.get('account.move.line')
56 account_move = self.pool.get('account.move')
57 res = super(stock_move, self).action_cancel(cr,uid,ids,context=context)
58 result = {}
59 for move in self.browse(cr, uid, ids, context=context):
60 account_move_line_id = account_move_line.search(cr,uid,[('stock_move_id','=',move.id)])
61 for move_line in account_move_line.browse(cr, uid, account_move_line_id, context=context):
62 result.setdefault(move_line.move_id.id, move.id)
63 for lin in result.items():
64 try:
65 account_move.button_cancel(cr, uid, [lin[0]], context=context)
66 except:
67 pass
68 account_move.unlink(cr, uid, [lin[0]])
69 return True
70
71stock_move()
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100