Merge lp:~vauxoo/addons-vauxoo/addons-vauxoo-61-mrp_request_return_cancel-dev-fernando into lp:addons-vauxoo/6.1

Proposed by Fernando Lopez
Status: Merged
Merged at revision: 547
Proposed branch: lp:~vauxoo/addons-vauxoo/addons-vauxoo-61-mrp_request_return_cancel-dev-fernando
Merge into: lp:addons-vauxoo/6.1
Diff against target: 131 lines (+113/-0)
3 files modified
mrp_request_return_cancel/__init__.py (+26/-0)
mrp_request_return_cancel/__openerp__.py (+40/-0)
mrp_request_return_cancel/mrp.py (+47/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/addons-vauxoo-61-mrp_request_return_cancel-dev-fernando
Reviewer Review Type Date Requested Status
Fernando Lopez (community) Needs Resubmitting
Moisés López - http://www.vauxoo.com Pending
Review via email: mp+131454@code.launchpad.net

Description of the change

Este módulo cancela los picking generados por los request o return del módulo mrp_request_return al cancelar la orden de producción respectiva.

To post a comment you must log in.
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :
Download full text (7.4 KiB)

Fer,
Cuando validas nulos, el unico que no validas es el id, ya que es un campo
requerido y siempre definido.

Es decir la validación
if line.id:
No tiene mucho sentido.
Al menos que el campo a leer sea un many2one.

Es decir,
if journal_id
   valor = journal_id.id

o
valor = journal_id and journal_id.id or False

Me explico?

Julio, me ayudas con palabras definir en vivo a Fer

Correo escrito desde un dispositivo móvil. Disculpa las faltas de
ortografía y la brevedad del email.
"No imprimas este email al menos que sea muy necesario, la ecología es cosa
de todos"

Moisés López - Vauxoo - moylop260
El 25/10/2012 12:17, "Fernando Lopez" <email address hidden> escribió:

> Fernando Lopez has proposed merging
> lp:~vauxoo/addons-vauxoo/addons-vauxoo-61-mrp_request_return_cancel-dev-fernando
> into lp:addons-vauxoo/6.1.
>
> Requested reviews:
> Moisés López - http://www.vauxoo.com (moylop260)
>
> For more details, see:
>
> https://code.launchpad.net/~vauxoo/addons-vauxoo/addons-vauxoo-61-mrp_request_return_cancel-dev-fernando/+merge/131454
>
> Este módulo cancela los picking generados por los request o return del
> módulo mrp_request_return al cancelar la orden de producción respectiva.
> --
>
> https://code.launchpad.net/~vauxoo/addons-vauxoo/addons-vauxoo-61-mrp_request_return_cancel-dev-fernando/+merge/131454
> You are requested to review the proposed merge of
> lp:~vauxoo/addons-vauxoo/addons-vauxoo-61-mrp_request_return_cancel-dev-fernando
> into lp:addons-vauxoo/6.1.
>
> === added directory 'mrp_request_return_cancel'
> === added file 'mrp_request_return_cancel/__init__.py'
> --- mrp_request_return_cancel/__init__.py 1970-01-01 00:00:00 +0000
> +++ mrp_request_return_cancel/__init__.py 2012-10-25 17:16:20 +0000
> @@ -0,0 +1,26 @@
> +# -*- coding: utf-8 -*-
>
> +###########################################################################
> +# Module Writen to OpenERP, Open Source Management Solution
> +#
> +# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
> +# All Rights Reserved.
> +# <email address hidden>
>
> +############################################################################
> +# Coded by: fernando L (<email address hidden>)
>
> +############################################################################
> +#
> +# This program is free software: you can redistribute it and/or modify
> +# it under the terms of the GNU Affero General Public License as
> +# published by the Free Software Foundation, either version 3 of the
> +# License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU Affero General Public License for more details.
> +#
> +# You should have received a copy of the GNU Affero General Public
> License
> +# along with this program. If not, see <http://www.gnu.org/licenses/
> >.
> +#
>
> +############################################################################
> +import mrp
> \ No newline at end of file
>
> === added file 'mrp_request_return_cancel/__opene...

Read more...

543. By Fernando Lopez

[IMP] Deleted extra validation on a required field

Revision history for this message
Fernando Lopez (kyon) wrote :

Se le eliminó la validación de sobra.

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'mrp_request_return_cancel'
2=== added file 'mrp_request_return_cancel/__init__.py'
3--- mrp_request_return_cancel/__init__.py 1970-01-01 00:00:00 +0000
4+++ mrp_request_return_cancel/__init__.py 2012-10-25 18:58:23 +0000
5@@ -0,0 +1,26 @@
6+# -*- coding: utf-8 -*-
7+###########################################################################
8+# Module Writen to OpenERP, Open Source Management Solution
9+#
10+# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
11+# All Rights Reserved.
12+# info@vauxoo.com
13+############################################################################
14+# Coded by: fernando L (fernando_ld@vauxoo.com)
15+############################################################################
16+#
17+# This program is free software: you can redistribute it and/or modify
18+# it under the terms of the GNU Affero General Public License as
19+# published by the Free Software Foundation, either version 3 of the
20+# License, or (at your option) any later version.
21+#
22+# This program is distributed in the hope that it will be useful,
23+# but WITHOUT ANY WARRANTY; without even the implied warranty of
24+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25+# GNU Affero General Public License for more details.
26+#
27+# You should have received a copy of the GNU Affero General Public License
28+# along with this program. If not, see <http://www.gnu.org/licenses/>.
29+#
30+############################################################################
31+import mrp
32\ No newline at end of file
33
34=== added file 'mrp_request_return_cancel/__openerp__.py'
35--- mrp_request_return_cancel/__openerp__.py 1970-01-01 00:00:00 +0000
36+++ mrp_request_return_cancel/__openerp__.py 2012-10-25 18:58:23 +0000
37@@ -0,0 +1,40 @@
38+# -*- coding: utf-8 -*-
39+###########################################################################
40+# Module Writen to OpenERP, Open Source Management Solution
41+#
42+# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
43+# All Rights Reserved.
44+# info@vauxoo.com
45+############################################################################
46+# Coded by: fernando L (fernando_ld@vauxoo.com)
47+############################################################################
48+#
49+# This program is free software: you can redistribute it and/or modify
50+# it under the terms of the GNU Affero General Public License as
51+# published by the Free Software Foundation, either version 3 of the
52+# License, or (at your option) any later version.
53+#
54+# This program is distributed in the hope that it will be useful,
55+# but WITHOUT ANY WARRANTY; without even the implied warranty of
56+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57+# GNU Affero General Public License for more details.
58+#
59+# You should have received a copy of the GNU Affero General Public License
60+# along with this program. If not, see <http://www.gnu.org/licenses/>.
61+#
62+##############################################################################
63+{
64+ 'name': 'MRP request return cancel',
65+ "version" : "1.0",
66+ 'author': 'Vauxoo',
67+ 'depends': ['mrp_request_return','mrp_production_cancel'],
68+ 'description': """
69+ Allows to cancel stock moves that are generated by a request or return of product.
70+ """,
71+ 'update_xml':[
72+
73+ ],
74+ 'active': False,
75+ 'category': 'MRP',
76+ 'installable': True
77+}
78\ No newline at end of file
79
80=== added file 'mrp_request_return_cancel/mrp.py'
81--- mrp_request_return_cancel/mrp.py 1970-01-01 00:00:00 +0000
82+++ mrp_request_return_cancel/mrp.py 2012-10-25 18:58:23 +0000
83@@ -0,0 +1,47 @@
84+# -*- coding: utf-8 -*-
85+###########################################################################
86+# Module Writen to OpenERP, Open Source Management Solution
87+#
88+# Copyright (c) 2012 Vauxoo - http://www.vauxoo.com
89+# All Rights Reserved.
90+# info@vauxoo.com
91+############################################################################
92+# Coded by: julio (fernando_ld@vauxoo.com)
93+############################################################################
94+#
95+# This program is free software: you can redistribute it and/or modify
96+# it under the terms of the GNU Affero General Public License as
97+# published by the Free Software Foundation, either version 3 of the
98+# License, or (at your option) any later version.
99+#
100+# This program is distributed in the hope that it will be useful,
101+# but WITHOUT ANY WARRANTY; without even the implied warranty of
102+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
103+# GNU Affero General Public License for more details.
104+#
105+# You should have received a copy of the GNU Affero General Public License
106+# along with this program. If not, see <http://www.gnu.org/licenses/>.
107+#
108+##############################################################################
109+from osv import osv, fields
110+from tools.translate import _
111+from datetime import datetime
112+import netsvc
113+
114+class mrp_production(osv.osv):
115+ _inherit = "mrp.production"
116+
117+ def action_cancel(self, cr, uid, ids, context=None):
118+
119+ if context is None:
120+ context = {}
121+
122+ wf_service = netsvc.LocalService("workflow")
123+
124+ move_obj = self.pool.get('stock.move')
125+ for production in self.browse(cr, uid, ids, context=context):
126+ for line in production.picking_ids:
127+ wf_service.trg_validate(uid, 'stock.picking', line.id, 'button_cancel', cr)
128+ return super(mrp_production, self).action_cancel(cr, uid, ids, context=context)
129+
130+mrp_production()
131\ No newline at end of file