Merge lp:~vauxoo/addons-vauxoo/addons-vauxoo_stock_picking_validate_past_dev_luis into lp:addons-vauxoo

Proposed by Luis Torres - http://www.vauxoo.com
Status: Merged
Merged at revision: 529
Proposed branch: lp:~vauxoo/addons-vauxoo/addons-vauxoo_stock_picking_validate_past_dev_luis
Merge into: lp:addons-vauxoo
Diff against target: 266 lines (+241/-0)
5 files modified
stock_picking_validate_past/__init__.py (+27/-0)
stock_picking_validate_past/__openerp__.py (+40/-0)
stock_picking_validate_past/stock.py (+61/-0)
stock_picking_validate_past/stock_partial_move.py (+42/-0)
stock_picking_validate_past/stock_view.xml (+71/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/addons-vauxoo_stock_picking_validate_past_dev_luis
Reviewer Review Type Date Requested Status
Luis Torres - http://www.vauxoo.com Needs Resubmitting
Moisés López - http://www.vauxoo.com Pending
Isaac López Zúñiga Pending
Review via email: mp+127910@code.launchpad.net

Description of the change

Se agrego un campo selection: type_process_date
si este campo es = 'current_date', hace el proceso tal como esta al validar el movimiento del picking
y si es 'planned_date', en el campo de 'create_date' agrega el valor que se capturo en 'date_expected'

To post a comment you must log in.
494. By Luis Torres - http://www.vauxoo.com

[ADD][stock_picking_validate_past]add in view to account_pickin, in field 'move_lines', field create in stock.piking

495. By Luis Torres - http://www.vauxoo.com

[IMP]stock_picking_validate_past]Change function that process the moves

Revision history for this message
Luis Torres - http://www.vauxoo.com (luis-cleto-) wrote :

Se modificaron las funciones que escriben el campo 'date', el cual ahora primero valida si el campo type_process_date=planned_date, y si asi es escribe en date la misma fecha que en date_expected

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'stock_picking_validate_past'
=== added file 'stock_picking_validate_past/__init__.py'
--- stock_picking_validate_past/__init__.py 1970-01-01 00:00:00 +0000
+++ stock_picking_validate_past/__init__.py 2012-10-04 23:32:23 +0000
@@ -0,0 +1,27 @@
1# -*- encoding: utf-8 -*-
2###########################################################################
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8############################################################################
9# Coded by: Luis Torres (luis_t@vauxoo.com)
10############################################################################
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25##############################################################################
26import stock
27import stock_partial_move
028
=== added file 'stock_picking_validate_past/__openerp__.py'
--- stock_picking_validate_past/__openerp__.py 1970-01-01 00:00:00 +0000
+++ stock_picking_validate_past/__openerp__.py 2012-10-04 23:32:23 +0000
@@ -0,0 +1,40 @@
1# -*- encoding: utf-8 -*-
2###########################################################################
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8############################################################################
9# Coded by: Luis Torres (luis_t@vauxoo.com)
10############################################################################
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25##############################################################################
26{
27 'name': 'Stock Validate Past',
28 "version" : "1.1",
29 'author': 'Vauxoo',
30 "category" : "Warehouse Management",
31 "website" : "http://www.vauxoo.com/",
32 'depends': ['stock',],
33 'description': """
34This module add the selection field "type_process_date", if its value = planned_date the field date_create takes the value from date_expected
35 """,
36 'update_xml':[
37 'stock_view.xml'],
38 'active':False,
39 'installable':True
40}
041
=== added file 'stock_picking_validate_past/stock.py'
--- stock_picking_validate_past/stock.py 1970-01-01 00:00:00 +0000
+++ stock_picking_validate_past/stock.py 2012-10-04 23:32:23 +0000
@@ -0,0 +1,61 @@
1# -*- encoding: utf-8 -*-
2###########################################################################
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8############################################################################
9# Coded by: Luis Torres (luis_t@vauxoo.com)
10############################################################################
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25##############################################################################
26from osv import fields, osv
27from lxml import etree
28
29class stock_move(osv.osv):
30 _inherit= "stock.move"
31
32 _columns={
33 'type_process_date':fields.selection([
34 ('current_date','Current Date'),
35 ('planned_date','Planned Date'),
36 ],readonly=True,string='Type Process Date',states={'draft': [('readonly', False)]}),
37 }
38
39 _defaults = {
40 'type_process_date': 'current_date',
41 }
42
43 def action_confirm(self, cr, uid, ids, context=None):
44 res=super(stock_move,self).action_confirm(cr,uid,ids,context=context)
45 for id_move in ids:
46 move=self.browse(cr,uid,id_move)
47 type_pross_date=move.type_process_date
48 date_expect=move.date_expected
49 if type_pross_date=='planned_date':
50 self.write(cr, uid, ids, {'create_date': date_expect})
51 return res
52
53 def action_done(self, cr, uid, ids, context=None):
54 res=super(stock_move,self).action_done(cr,uid,ids,context=context)
55 for id_move in ids:
56 move=self.browse(cr,uid,id_move)
57 type_pross_date=move.type_process_date
58 date_expect=move.date_expected
59 if type_pross_date=='planned_date':
60 self.write(cr, uid, ids, {'date': date_expect})
61 return res
062
=== added file 'stock_picking_validate_past/stock_partial_move.py'
--- stock_picking_validate_past/stock_partial_move.py 1970-01-01 00:00:00 +0000
+++ stock_picking_validate_past/stock_partial_move.py 2012-10-04 23:32:23 +0000
@@ -0,0 +1,42 @@
1# -*- encoding: utf-8 -*-
2###########################################################################
3# Module Writen to OpenERP, Open Source Management Solution
4#
5# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
6# All Rights Reserved.
7# info Vauxoo (info@vauxoo.com)
8############################################################################
9# Coded by: Luis Torres (luis_t@vauxoo.com)
10############################################################################
11#
12# This program is free software: you can redistribute it and/or modify
13# it under the terms of the GNU Affero General Public License as
14# published by the Free Software Foundation, either version 3 of the
15# License, or (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU Affero General Public License for more details.
21#
22# You should have received a copy of the GNU Affero General Public License
23# along with this program. If not, see <http://www.gnu.org/licenses/>.
24#
25##############################################################################
26from osv import fields, osv
27
28class stock_partial_move(osv.osv_memory):
29 _inherit = "stock.partial.move"
30
31 def do_partial(self, cr, uid, ids, context=None):
32 res=super(stock_partial_move,self).do_partial(cr, uid, ids, context=context)
33 stock_move_obj=self.pool.get('stock.move')
34 ids_validate=context.get('active_ids')
35 for id_move in ids_validate:
36 move=stock_move_obj.browse(cr,uid,id_move)
37 type_pross_date=move.type_process_date
38 date_expect=move.date_expected
39 if type_pross_date=='planned_date':
40 stock_move_obj.write(cr, uid, id_move, {'date': date_expect})
41
42 return res
043
=== added file 'stock_picking_validate_past/stock_view.xml'
--- stock_picking_validate_past/stock_view.xml 1970-01-01 00:00:00 +0000
+++ stock_picking_validate_past/stock_view.xml 2012-10-04 23:32:23 +0000
@@ -0,0 +1,71 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4<!--
5 Stock move inc
6-->
7 <record model="ir.ui.view" id="view_stock_move_inc_inherit_type_pross_date_form">
8 <field name="name">view.stock.move.inc.inherit.imported.type.pross.date.form</field>
9 <field name="model">stock.move</field>
10 <field name="type">form</field>
11 <field name="inherit_id" ref="stock.view_move_form_reception_picking"/>
12 <field name="arch" type="xml">
13 <xpath expr="/form/group/field[@name='company_id']" position="after">
14 <field name="type_process_date" colspan="2"/>
15 </xpath>
16 </field>
17 </record>
18
19<!--
20 stock move out
21-->
22 <record model="ir.ui.view" id="view_stock_move_out_inherit_type_pross_date_form">
23 <field name="name">view.stock.move.out.inherit.type.pross.date.form</field>
24 <field name="model">stock.move</field>
25 <field name="type">form</field>
26 <field name="inherit_id" ref="stock.view_move_form"/>
27 <field name="arch" type="xml">
28 <xpath expr="/form/group/field[@name='company_id']" position="after">
29 <field name="type_process_date" colspan="2"/>
30 </xpath>
31 </field>
32 </record>
33
34 <record model="ir.ui.view" id="view_stock_move_lines_int_inherit_type_pross_date_form">
35 <field name="name">view.stock.move.lines.int.inherit.type.pross.date.form</field>
36 <field name="model">stock.picking</field>
37 <field name="type">form</field>
38 <field name="inherit_id" ref="stock.view_picking_form"/>
39 <field name="arch" type="xml">
40 <xpath expr="/form/notebook/page/field[@name='move_lines']/form[@string='Stock Moves']/group/field[@name='location_dest_id']" position="after">
41 <field name="type_process_date" colspan="2"/>
42 </xpath>
43 </field>
44 </record>
45
46 <record model="ir.ui.view" id="view_stock_move_lines_out_inherit_type_pross_date_form">
47 <field name="name">view.stock.move.lines.out.inherit.type.pross.date.form</field>
48 <field name="model">stock.picking</field>
49 <field name="type">form</field>
50 <field name="inherit_id" ref="stock.view_picking_out_form"/>
51 <field name="arch" type="xml">
52 <xpath expr="/form/notebook/page/field[@name='move_lines']/form[@string='Stock Moves']/group/field[@name='location_dest_id']" position="after">
53 <field name="type_process_date" colspan="2"/>
54 </xpath>
55 </field>
56 </record>
57
58 <record model="ir.ui.view" id="view_stock_move_lines_inc_inherit_type_pross_date_form">
59 <field name="name">view.stock.move.lines.inc.inherit.type.pross.date.form</field>
60 <field name="model">stock.picking</field>
61 <field name="type">form</field>
62 <field name="inherit_id" ref="stock.view_picking_in_form"/>
63 <field name="arch" type="xml">
64 <xpath expr="/form/notebook/page/field[@name='move_lines']/form[@string='Stock Moves']/group/field[@name='location_dest_id']" position="after">
65 <field name="type_process_date" colspan="2"/>
66 </xpath>
67 </field>
68 </record>
69
70 </data>
71</openerp>