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
1=== added directory 'stock_picking_validate_past'
2=== added file 'stock_picking_validate_past/__init__.py'
3--- stock_picking_validate_past/__init__.py 1970-01-01 00:00:00 +0000
4+++ stock_picking_validate_past/__init__.py 2012-10-04 23:32:23 +0000
5@@ -0,0 +1,27 @@
6+# -*- encoding: utf-8 -*-
7+###########################################################################
8+# Module Writen to OpenERP, Open Source Management Solution
9+#
10+# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
11+# All Rights Reserved.
12+# info Vauxoo (info@vauxoo.com)
13+############################################################################
14+# Coded by: Luis Torres (luis_t@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 stock
32+import stock_partial_move
33
34=== added file 'stock_picking_validate_past/__openerp__.py'
35--- stock_picking_validate_past/__openerp__.py 1970-01-01 00:00:00 +0000
36+++ stock_picking_validate_past/__openerp__.py 2012-10-04 23:32:23 +0000
37@@ -0,0 +1,40 @@
38+# -*- encoding: utf-8 -*-
39+###########################################################################
40+# Module Writen to OpenERP, Open Source Management Solution
41+#
42+# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
43+# All Rights Reserved.
44+# info Vauxoo (info@vauxoo.com)
45+############################################################################
46+# Coded by: Luis Torres (luis_t@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': 'Stock Validate Past',
65+ "version" : "1.1",
66+ 'author': 'Vauxoo',
67+ "category" : "Warehouse Management",
68+ "website" : "http://www.vauxoo.com/",
69+ 'depends': ['stock',],
70+ 'description': """
71+This module add the selection field "type_process_date", if its value = planned_date the field date_create takes the value from date_expected
72+ """,
73+ 'update_xml':[
74+ 'stock_view.xml'],
75+ 'active':False,
76+ 'installable':True
77+}
78
79=== added file 'stock_picking_validate_past/stock.py'
80--- stock_picking_validate_past/stock.py 1970-01-01 00:00:00 +0000
81+++ stock_picking_validate_past/stock.py 2012-10-04 23:32:23 +0000
82@@ -0,0 +1,61 @@
83+# -*- encoding: utf-8 -*-
84+###########################################################################
85+# Module Writen to OpenERP, Open Source Management Solution
86+#
87+# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
88+# All Rights Reserved.
89+# info Vauxoo (info@vauxoo.com)
90+############################################################################
91+# Coded by: Luis Torres (luis_t@vauxoo.com)
92+############################################################################
93+#
94+# This program is free software: you can redistribute it and/or modify
95+# it under the terms of the GNU Affero General Public License as
96+# published by the Free Software Foundation, either version 3 of the
97+# License, or (at your option) any later version.
98+#
99+# This program is distributed in the hope that it will be useful,
100+# but WITHOUT ANY WARRANTY; without even the implied warranty of
101+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
102+# GNU Affero General Public License for more details.
103+#
104+# You should have received a copy of the GNU Affero General Public License
105+# along with this program. If not, see <http://www.gnu.org/licenses/>.
106+#
107+##############################################################################
108+from osv import fields, osv
109+from lxml import etree
110+
111+class stock_move(osv.osv):
112+ _inherit= "stock.move"
113+
114+ _columns={
115+ 'type_process_date':fields.selection([
116+ ('current_date','Current Date'),
117+ ('planned_date','Planned Date'),
118+ ],readonly=True,string='Type Process Date',states={'draft': [('readonly', False)]}),
119+ }
120+
121+ _defaults = {
122+ 'type_process_date': 'current_date',
123+ }
124+
125+ def action_confirm(self, cr, uid, ids, context=None):
126+ res=super(stock_move,self).action_confirm(cr,uid,ids,context=context)
127+ for id_move in ids:
128+ move=self.browse(cr,uid,id_move)
129+ type_pross_date=move.type_process_date
130+ date_expect=move.date_expected
131+ if type_pross_date=='planned_date':
132+ self.write(cr, uid, ids, {'create_date': date_expect})
133+ return res
134+
135+ def action_done(self, cr, uid, ids, context=None):
136+ res=super(stock_move,self).action_done(cr,uid,ids,context=context)
137+ for id_move in ids:
138+ move=self.browse(cr,uid,id_move)
139+ type_pross_date=move.type_process_date
140+ date_expect=move.date_expected
141+ if type_pross_date=='planned_date':
142+ self.write(cr, uid, ids, {'date': date_expect})
143+ return res
144
145=== added file 'stock_picking_validate_past/stock_partial_move.py'
146--- stock_picking_validate_past/stock_partial_move.py 1970-01-01 00:00:00 +0000
147+++ stock_picking_validate_past/stock_partial_move.py 2012-10-04 23:32:23 +0000
148@@ -0,0 +1,42 @@
149+# -*- encoding: utf-8 -*-
150+###########################################################################
151+# Module Writen to OpenERP, Open Source Management Solution
152+#
153+# Copyright (c) 2010 Vauxoo - http://www.vauxoo.com/
154+# All Rights Reserved.
155+# info Vauxoo (info@vauxoo.com)
156+############################################################################
157+# Coded by: Luis Torres (luis_t@vauxoo.com)
158+############################################################################
159+#
160+# This program is free software: you can redistribute it and/or modify
161+# it under the terms of the GNU Affero General Public License as
162+# published by the Free Software Foundation, either version 3 of the
163+# License, or (at your option) any later version.
164+#
165+# This program is distributed in the hope that it will be useful,
166+# but WITHOUT ANY WARRANTY; without even the implied warranty of
167+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
168+# GNU Affero General Public License for more details.
169+#
170+# You should have received a copy of the GNU Affero General Public License
171+# along with this program. If not, see <http://www.gnu.org/licenses/>.
172+#
173+##############################################################################
174+from osv import fields, osv
175+
176+class stock_partial_move(osv.osv_memory):
177+ _inherit = "stock.partial.move"
178+
179+ def do_partial(self, cr, uid, ids, context=None):
180+ res=super(stock_partial_move,self).do_partial(cr, uid, ids, context=context)
181+ stock_move_obj=self.pool.get('stock.move')
182+ ids_validate=context.get('active_ids')
183+ for id_move in ids_validate:
184+ move=stock_move_obj.browse(cr,uid,id_move)
185+ type_pross_date=move.type_process_date
186+ date_expect=move.date_expected
187+ if type_pross_date=='planned_date':
188+ stock_move_obj.write(cr, uid, id_move, {'date': date_expect})
189+
190+ return res
191
192=== added file 'stock_picking_validate_past/stock_view.xml'
193--- stock_picking_validate_past/stock_view.xml 1970-01-01 00:00:00 +0000
194+++ stock_picking_validate_past/stock_view.xml 2012-10-04 23:32:23 +0000
195@@ -0,0 +1,71 @@
196+<?xml version="1.0" encoding="utf-8"?>
197+<openerp>
198+ <data>
199+<!--
200+ Stock move inc
201+-->
202+ <record model="ir.ui.view" id="view_stock_move_inc_inherit_type_pross_date_form">
203+ <field name="name">view.stock.move.inc.inherit.imported.type.pross.date.form</field>
204+ <field name="model">stock.move</field>
205+ <field name="type">form</field>
206+ <field name="inherit_id" ref="stock.view_move_form_reception_picking"/>
207+ <field name="arch" type="xml">
208+ <xpath expr="/form/group/field[@name='company_id']" position="after">
209+ <field name="type_process_date" colspan="2"/>
210+ </xpath>
211+ </field>
212+ </record>
213+
214+<!--
215+ stock move out
216+-->
217+ <record model="ir.ui.view" id="view_stock_move_out_inherit_type_pross_date_form">
218+ <field name="name">view.stock.move.out.inherit.type.pross.date.form</field>
219+ <field name="model">stock.move</field>
220+ <field name="type">form</field>
221+ <field name="inherit_id" ref="stock.view_move_form"/>
222+ <field name="arch" type="xml">
223+ <xpath expr="/form/group/field[@name='company_id']" position="after">
224+ <field name="type_process_date" colspan="2"/>
225+ </xpath>
226+ </field>
227+ </record>
228+
229+ <record model="ir.ui.view" id="view_stock_move_lines_int_inherit_type_pross_date_form">
230+ <field name="name">view.stock.move.lines.int.inherit.type.pross.date.form</field>
231+ <field name="model">stock.picking</field>
232+ <field name="type">form</field>
233+ <field name="inherit_id" ref="stock.view_picking_form"/>
234+ <field name="arch" type="xml">
235+ <xpath expr="/form/notebook/page/field[@name='move_lines']/form[@string='Stock Moves']/group/field[@name='location_dest_id']" position="after">
236+ <field name="type_process_date" colspan="2"/>
237+ </xpath>
238+ </field>
239+ </record>
240+
241+ <record model="ir.ui.view" id="view_stock_move_lines_out_inherit_type_pross_date_form">
242+ <field name="name">view.stock.move.lines.out.inherit.type.pross.date.form</field>
243+ <field name="model">stock.picking</field>
244+ <field name="type">form</field>
245+ <field name="inherit_id" ref="stock.view_picking_out_form"/>
246+ <field name="arch" type="xml">
247+ <xpath expr="/form/notebook/page/field[@name='move_lines']/form[@string='Stock Moves']/group/field[@name='location_dest_id']" position="after">
248+ <field name="type_process_date" colspan="2"/>
249+ </xpath>
250+ </field>
251+ </record>
252+
253+ <record model="ir.ui.view" id="view_stock_move_lines_inc_inherit_type_pross_date_form">
254+ <field name="name">view.stock.move.lines.inc.inherit.type.pross.date.form</field>
255+ <field name="model">stock.picking</field>
256+ <field name="type">form</field>
257+ <field name="inherit_id" ref="stock.view_picking_in_form"/>
258+ <field name="arch" type="xml">
259+ <xpath expr="/form/notebook/page/field[@name='move_lines']/form[@string='Stock Moves']/group/field[@name='location_dest_id']" position="after">
260+ <field name="type_process_date" colspan="2"/>
261+ </xpath>
262+ </field>
263+ </record>
264+
265+ </data>
266+</openerp>