← Back to team overview

avanzosc team mailing list archive

Re: [Merge] lp:~oihanecruce/avanzosc/nayar_stock_picking_additional_info into lp:~avanzosc-security-team/avanzosc/72horas

 

Review: Needs Fixing code review

Una sola cuestión entre líneas.

Diff comments:

> === modified file 'nayar_stock_picking_additional_info/__init__.py'
> --- nayar_stock_picking_additional_info/__init__.py	2014-06-11 10:23:47 +0000
> +++ nayar_stock_picking_additional_info/__init__.py	2014-06-23 10:23:02 +0000
> @@ -19,7 +19,4 @@
>  #
>  ##############################################################################
>  
> -import stock
> -
> -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
> -
> +from . import models
> 
> === modified file 'nayar_stock_picking_additional_info/__openerp__.py'
> --- nayar_stock_picking_additional_info/__openerp__.py	2014-06-11 10:23:47 +0000
> +++ nayar_stock_picking_additional_info/__openerp__.py	2014-06-23 10:23:02 +0000
> @@ -20,17 +20,14 @@
>  ##############################################################################
>  
>  {
> -	"name" : "Nayar Stock Picking Additional Info",
> -	"version" : "1.0",
> -	"author" : "Nayar Systems",
> -	"category" : "Stock, Delivery",
> -	"description":"Informacion extra para los albaranes de Nayar Systems",
> -	"depends" : ["stock", "delivery"],
> -	"init_xml" : [],
> -	"demo_xml" : [],
> -	"update_xml" : ['stock_view.xml'],
> -	"website": 'http://www.72horas.net/',
> -	"active": False,
> -	"installable": True
> +    "name": "Nayar Stock Picking Additional Info",
> +    "version": "1.0",
> +    "author": "Nayar Systems",
> +    "category": "Stock, Delivery",
> +    "description": "Informacion extra para los albaranes de Nayar Systems",
> +    "depends": ["stock", "delivery"],
> +    "data": ['views/stock_view.xml'],
> +    "website": 'http://www.72horas.net/',
> +    "active": False,
> +    "installable": True
>  }
> -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
> 
> === added directory 'nayar_stock_picking_additional_info/models'
> === added file 'nayar_stock_picking_additional_info/models/__init__.py'
> --- nayar_stock_picking_additional_info/models/__init__.py	1970-01-01 00:00:00 +0000
> +++ nayar_stock_picking_additional_info/models/__init__.py	2014-06-23 10:23:02 +0000
> @@ -0,0 +1,22 @@
> +# -*- coding: utf-8 -*-
> +##############################################################################
> +#
> +#    OpenERP, Open Source Management Solution
> +#    Copyright (C) 2013 Nayar Systems (<http://www.72horas.net/>)
> +#
> +#    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 . import stock
> 
> === renamed file 'nayar_stock_picking_additional_info/stock.py' => 'nayar_stock_picking_additional_info/models/stock.py'
> --- nayar_stock_picking_additional_info/stock.py	2014-06-11 10:23:47 +0000
> +++ nayar_stock_picking_additional_info/models/stock.py	2014-06-23 10:23:02 +0000
> @@ -19,19 +19,22 @@
>  #
>  ##############################################################################
>  
> -from osv import fields, osv
> -
> -class stock_picking(osv.osv):
> -    _inherit ="stock.picking"
> -	
> +from openerp.osv import fields, orm
> +
> +
> +class StockPicking(orm.Model):
> +    _inherit = "stock.picking"
> +
>      _columns = {
> -        'tipo_porte': fields.selection([('debidos', 'Debidos'), ('pagados', 'Pagados')], 'Portes', required=True),
> -        'designacion': fields.selection([('sobre', 'Sobre'), ('paquete', 'Paquete')], 'Designacion', required=True),
> -        }
> +        'tipo_porte': fields.selection([('debidos', 'Debidos'),
> +                                        ('pagados', 'Pagados')],
> +                                       'Portes', required=True),
> +        'designacion': fields.selection([('sobre', 'Sobre'),
> +                                         ('paquete', 'Paquete')],
> +                                        'Designacion', required=True),
> +    }
>  
>      _defaults = {
>          'tipo_porte': 'pagados',
>          'designacion': 'sobre',
> -        }
> -
> -stock_picking()
> +    }
> 
> === added directory 'nayar_stock_picking_additional_info/views'
> === renamed file 'nayar_stock_picking_additional_info/stock_view.xml' => 'nayar_stock_picking_additional_info/views/stock_view.xml'
> --- nayar_stock_picking_additional_info/stock_view.xml	2014-06-11 10:23:47 +0000
> +++ nayar_stock_picking_additional_info/views/stock_view.xml	2014-06-23 10:23:02 +0000
> @@ -1,22 +1,22 @@
>  <?xml version="1.0" encoding="utf-8"?>
>  <openerp>
> -  <data>
> -    <record id="view_picking_out_form_additional_info" model="ir.ui.view">
> -      <field name="name">stock.picking.out.form.additional_info</field>
> -      <field name="model">stock.picking</field>
> -      <field name="inherit_id" ref="delivery.view_picking_withcarrier_out_form"/>
> -      <field name="type">form</field>
> -      <field name="priority">1</field>
> -      <field name="arch" type="xml">
> -	<field name="address_id" position="replace">
> -	  <field name="address_id"/>
> -	  <field name="contact_id"/>
> -	</field>
> -	<field name="invoice_state" position="after">
> -	  <field name="tipo_porte" />
> -	  <field name="designacion" />
> -	</field>
> -      </field>
> -    </record>
> -  </data>
> +    <data>
> +        <record id="view_picking_out_form_additional_info" model="ir.ui.view">
> +            <field name="name">stock.picking.out.form.additional_info</field>
> +            <field name="model">stock.picking</field>
> +            <field name="inherit_id"
> +                ref="delivery.view_picking_withcarrier_out_form" />
> +            <field name="priority">1</field>
> +            <field name="arch" type="xml">
> +                <field name="address_id" position="replace">

No utilices replace. De hecho, address_id ya no existe, si no que es partner_id, por lo que se puede referenciar directamente un contacto. Lo que sí que habrá que hacer será poner un script de migración para este módulo. Apúntalo por favor en la tarea.

> +                    <field name="address_id" />
> +                    <field name="contact_id" />
> +                </field>
> +                <field name="invoice_state" position="after">
> +                    <field name="tipo_porte" />
> +                    <field name="designacion" />
> +                </field>
> +            </field>
> +        </record>
> +    </data>
>  </openerp>
> 


-- 
https://code.launchpad.net/~oihanecruce/avanzosc/nayar_stock_picking_additional_info/+merge/224093
Your team Avanzosc_security is subscribed to branch lp:~avanzosc-security-team/avanzosc/72horas.


References