Code review comment for lp:~vauxoo/addons-vauxoo/addons-vauxoo-61-mrp_request_return_cancel-dev-fernando

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

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/__openerp__.py'
> --- mrp_request_return_cancel/__openerp__.py 1970-01-01 00:00:00 +0000
> +++ mrp_request_return_cancel/__openerp__.py 2012-10-25 17:16:20 +0000
> @@ -0,0 +1,40 @@
> +# -*- 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/
> >.
> +#
>
> +##############################################################################
> +{
> + 'name': 'MRP request return cancel',
> + "version" : "1.0",
> + 'author': 'Vauxoo',
> + 'depends': ['mrp_request_return','mrp_production_cancel'],
> + 'description': """
> + Allows to cancel stock moves that are generated by a request or
> return of product.
> + """,
> + 'update_xml':[
> +
> + ],
> + 'active': False,
> + 'category': 'MRP',
> + 'installable': True
> +}
> \ No newline at end of file
>
> === added file 'mrp_request_return_cancel/mrp.py'
> --- mrp_request_return_cancel/mrp.py 1970-01-01 00:00:00 +0000
> +++ mrp_request_return_cancel/mrp.py 2012-10-25 17:16:20 +0000
> @@ -0,0 +1,48 @@
> +# -*- 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: julio (<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/
> >.
> +#
>
> +##############################################################################
> +from osv import osv, fields
> +from tools.translate import _
> +from datetime import datetime
> +import netsvc
> +
> +class mrp_production(osv.osv):
> + _inherit = "mrp.production"
> +
> + def action_cancel(self, cr, uid, ids, context=None):
> +
> + if context is None:
> + context = {}
> +
> + wf_service = netsvc.LocalService("workflow")
> +
> + move_obj = self.pool.get('stock.move')
> + for production in self.browse(cr, uid, ids, context=context):
> + for line in production.picking_ids:
> + if line.id:
> + wf_service.trg_validate(uid, 'stock.picking', line.id,
> 'button_cancel', cr)
> + return super(mrp_production, self).action_cancel(cr, uid, ids,
> context=context)
> +
> +mrp_production()
> \ No newline at end of file
>
>
>

« Back to merge proposal