Merge lp:~openerp-dev/openobject-addons/trunk-bug-1089002-kbh into lp:openobject-addons

Proposed by Khushboo Bhatt(openerp)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1089002-kbh
Merge into: lp:openobject-addons
Diff against target: 118 lines (+25/-4)
5 files modified
stock/stock.py (+1/-0)
stock/stock_view.xml (+6/-2)
stock/wizard/stock_partial_picking_view.xml (+1/-1)
stock/wizard/stock_return_picking.py (+9/-0)
stock/wizard/stock_return_picking_view.xml (+8/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1089002-kbh
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+140152@code.launchpad.net

Description of the change

Hello,
 stock:solved the problem of after Return the all deliver product, the "Return Products" button still there and can not add new products while deliver or return the products.

Thank you,
Khushboo.

To post a comment you must log in.
8296. By Khushboo Bhatt(openerp)

[FIX]:stock:improved code

8297. By Khushboo Bhatt(openerp)

[FIX]conflicts resolved

Unmerged revisions

8297. By Khushboo Bhatt(openerp)

[FIX]conflicts resolved

8296. By Khushboo Bhatt(openerp)

[FIX]:stock:improved code

8295. By Khushboo Bhatt(openerp)

[MERGE]merge with trunk

8294. By Khushboo Bhatt(openerp)

[FIX]:stock:once return product return product button is not visible and can not add item when deliver or receive the product

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/stock.py'
2--- stock/stock.py 2012-12-16 15:57:40 +0000
3+++ stock/stock.py 2012-12-17 10:17:23 +0000
4@@ -668,6 +668,7 @@
5 ("none", "Not Applicable")], "Invoice Control",
6 select=True, required=True, readonly=True, states={'draft': [('readonly', False)]}),
7 'company_id': fields.many2one('res.company', 'Company', required=True, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
8+ 'return_products': fields.boolean('Return Products'),
9 }
10 _defaults = {
11 'name': lambda self, cr, uid, context: '/',
12
13=== modified file 'stock/stock_view.xml'
14--- stock/stock_view.xml 2012-12-14 16:07:36 +0000
15+++ stock/stock_view.xml 2012-12-17 10:17:23 +0000
16@@ -772,6 +772,7 @@
17 <field name="date"/>
18 <field name="min_date" readonly="1" attrs="{'invisible': [('min_date','=',False)]}"/>
19 <field name="origin" placeholder="e.g. PO0032" class="oe_inline"/>
20+ <field name="return_products" invisible="1"/>
21 </group>
22 </group>
23 <notebook>
24@@ -895,7 +896,7 @@
25 </field>
26 <xpath expr="/form/header//button[@name='%(act_stock_return_picking)d']" position="replace">
27 <button name="%(report_picking_list_out)d" string="Print Delivery Slip" type="action" states="done" class="oe_highlight"/>
28- <button name="%(act_stock_return_picking)d" string="Return Products" states="done" type="action"/>
29+ <button name="%(act_stock_return_picking)d" string="Return Products" type="action" attrs="{'invisible': ['|', ('state', '!=' , 'done'), ('return_products', '=', True)]}"/>
30 </xpath>
31 <xpath expr="/form/header//button[@name='draft_validate']" position="replace">
32 <button name="draft_validate" states="draft" string="Confirm &amp; Deliver" type="object" class="oe_highlight"/>
33@@ -921,6 +922,7 @@
34 </xpath>
35 </field>
36 </record>
37+
38 <record id="view_picking_out_search" model="ir.ui.view">
39 <field name="name">stock.picking.out.search</field>
40 <field name="model">stock.picking</field>
41@@ -1016,6 +1018,7 @@
42 </tree>
43 </field>
44 </record>
45+
46 <record id="view_picking_in_form" model="ir.ui.view">
47 <field name="name">stock.picking.in.form</field>
48 <field name="model">stock.picking.in</field>
49@@ -1025,7 +1028,7 @@
50 <attribute name="string">Date of Reception</attribute>
51 </field>
52 <xpath expr="/form/header//button[@name='%(act_stock_return_picking)d']" position="replace">
53- <button name="%(act_stock_return_picking)d" string="Return Products" states="done" type="action"/>
54+ <button name="%(act_stock_return_picking)d" string="Return Products" type="action" attrs="{'invisible': ['|', ('state', '!=' , 'done'), ('return_products', '=', True)]}"/>
55 </xpath>
56 <xpath expr="//button[@name='draft_validate']" position="replace">
57 <button name="draft_validate" states="draft" string="Confirm &amp; Receive" type="object" class="oe_highlight"/>
58@@ -1047,6 +1050,7 @@
59 </xpath>
60 </field>
61 </record>
62+
63 <record id="view_picking_in_search" model="ir.ui.view">
64 <field name="name">stock.picking.in.search</field>
65 <field name="model">stock.picking.in</field>
66
67=== modified file 'stock/wizard/stock_partial_picking_view.xml'
68--- stock/wizard/stock_partial_picking_view.xml 2012-12-13 13:02:36 +0000
69+++ stock/wizard/stock_partial_picking_view.xml 2012-12-17 10:17:23 +0000
70@@ -18,7 +18,7 @@
71 <field name="hide_tracking" invisible="1"/>
72 <separator string="Transfer Products" name="product_separator"/>
73 <field name="move_ids" context="{'hide_tracking': hide_tracking}">
74- <tree editable="bottom" string="Product Moves">
75+ <tree string="Product Moves" create="false">
76 <field name="product_id" on_change="onchange_product_id(product_id)"/>
77 <field name="quantity" />
78 <field name="product_uom" groups="product.group_uom"/>
79
80=== modified file 'stock/wizard/stock_return_picking.py'
81--- stock/wizard/stock_return_picking.py 2012-12-06 15:38:56 +0000
82+++ stock/wizard/stock_return_picking.py 2012-12-17 10:17:23 +0000
83@@ -201,6 +201,15 @@
84 pick_obj.write(cr, uid, [pick.id], {'invoice_state':'none'}, context=context)
85 wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
86 pick_obj.force_assign(cr, uid, [new_picking], context)
87+
88+ valid_lines = 0
89+ return_history = self.get_return_history(cr, uid, record_id, context)
90+ for m in pick.move_lines:
91+ if m.state == 'done' and m.product_qty * m.product_uom.factor > return_history.get(m.id, 0):
92+ valid_lines += 1
93+ if not valid_lines:
94+ pick_obj.write(cr, uid, [pick.id], {'return_products': True}, context=context)
95+
96 # Update view id in context, lp:702939
97 model_list = {
98 'out': 'stock.picking.out',
99
100=== modified file 'stock/wizard/stock_return_picking_view.xml'
101--- stock/wizard/stock_return_picking_view.xml 2012-11-29 22:26:45 +0000
102+++ stock/wizard/stock_return_picking_view.xml 2012-12-17 10:17:23 +0000
103@@ -58,7 +58,14 @@
104 <form string="Return lines" version="7.0">
105 <label string="Provide the quantities of the returned products."/>
106 <group>
107- <field name="product_return_moves"/>
108+ <field name="product_return_moves">
109+ <tree string="Moves" create="false">
110+ <field name="product_id" />
111+ <field name="quantity" />
112+ </tree>
113+ </field>
114+ </group>
115+ <group>
116 <field name="invoice_state" />
117 </group>
118 <footer>

Subscribers

People subscribed via source and target branches

to all changes: