Merge lp:~openerp-dev/openobject-addons/6.0-opw-4972-improved-ach into lp:openobject-addons/6.0

Proposed by Anup(SerpentCS)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-4972-improved-ach
Merge into: lp:openobject-addons/6.0
Diff against target: 135 lines (+42/-18)
3 files modified
stock/stock.py (+6/-4)
stock/wizard/stock_move.py (+34/-14)
stock/wizard/stock_move_view.xml (+2/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-4972-improved-ach
Reviewer Review Type Date Requested Status
Jacques-Etienne Baudoux Pending
Jay Vora (Serpent Consulting Services) Pending
Review via email: mp+59026@code.launchpad.net

Description of the change

Hello Jay,

   I have improved the wizard and other functionalities.

Thanks.

To post a comment you must log in.
4547. By Jay Vora (Serpent Consulting Services)

[FIX] Lunch : Corrected YAML test, thanks to buildbot

4548. By Jay Vora (Serpent Consulting Services)

[FIX] Users_ldap : Corrected YAML Warnings,Thanks to Buildbot

4549. By Jay Vora (Serpent Consulting Services)

[Merge] Merged Main branch

4550. By Olivier Dony (Odoo)

[MERGE] report_webkit: fixes (mainly UTF8 issues), courtesy of Nicolas Bessi, C2C

4551. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4552. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4553. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4554. By xrg

[MERGE] base_crypt: missing import and better check for active users

4555. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Dhruti's branch for the fix on decimal accuracy

4556. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Marco's branch for the fix of lp:718609

4557. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4558. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4559. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4560. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4561. By Jay Vora (Serpent Consulting Services)

[FIX] l10n_fr : Corrected Template definitions (Ref: Case 5481)

4562. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Anup's branch for the fix of task created from Procurement

4563. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Jagdish' branch for the fix of bug lp:767058

4564. By Jay Vora (Serpent Consulting Services)

[FIX] Account : default_get() corrected in order to be compatible with web client

4565. By Jay Vora (Serpent Consulting Services)

[FIX] Account : Corrected _sum() of account.tax.code()

4566. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Dhruti's branch for the fix of lp:741457

4567. By Jay Vora (Serpent Consulting Services)

[FIX] Fixed warnings and test failures suggested by Buildbot

4568. By Jay Vora (Serpent Consulting Services)

[Merge]

4569. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4570. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4571. By Jay Vora (Serpent Consulting Services)

[FIX] Account_voucher : Added missing context to onchange_date() of voucher

4572. By Olivier Dony (Odoo)

[I18N] all: updated translation templates

4573. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4574. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4575. By Olivier Laurent (Open ERP)

[FIX] document: when updating attachment file size, exclude attachments having NULL db_datas (otherwise len() raises an exception)

4576. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Amit Dodiya's branch for the fix of account_followup rules issue

4577. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4578. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged the branch for the fix of lp:763439

4579. By Anup(SerpentCS)

[FIX] account : Move lines take the Journal and Period from the Move itself(Maintenance Case 5598)

4580. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4581. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4582. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4583. By Tristan Hill (credativ)

[MERGE] Merged Tristan Hill (credativ)'s branch for the fix of bug lp:733799

4584. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4585. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Rifakat's branch for the fix of onchange call

4586. By Jay Vora (Serpent Consulting Services)

[FIX] Purchase_requisition : Corrections and removed the unnecessary dependency of mrp

4587. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4588. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Valencia's branch for the fix of __compute method on account correctiosn when account is set to inActive

4589. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Dhruti's branch for the fix of the problem when base_contact disturbs the thunderbird

4590. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4591. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Anup's branch for the fix of invoice creation from repairs

4592. By Jay Vora (Serpent Consulting Services)

[REF] Stock : Improvements

4593. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Rifakat's branch which contains the fix of invoice progressbar which was showing wrong value by not considering the residual amount(It could have failed when the invoice is partially paid)

4594. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4595. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4596. By Jay Vora (Serpent Consulting Services)

Merged Tejas' branch for the fix of wrong reporting of product margin(Thanks to Rifakat for review)

4597. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Somesh' branch for the fix of domain correction for Sale Order's 'Invoice On' Policy

4598. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Amit Dodiya's branch for the fix of fields_view_get() failing on list view display of account.voucher

4599. By Anup(SerpentCS)

[MERGE] Merged RGO's branch for Query fix in Sale Manager Analysis Report(Case:5689)

4600. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4601. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4602. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4603. By Conexus.at

[ADD] l10n_at: added localization module for austria. Thanks Conexus.at

4604. By Rifakat Husen (OpenERP)

[FIX]: improvement for consume product wizard of manufacturing
* put check for active_id
*changed field track to boolean from dummy
* related useability improvements

Unmerged revisions

4604. By Rifakat Husen (OpenERP)

[FIX]: improvement for consume product wizard of manufacturing
* put check for active_id
*changed field track to boolean from dummy
* related useability improvements

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'stock/stock.py'
--- stock/stock.py 2011-05-18 15:40:44 +0000
+++ stock/stock.py 2011-05-23 13:36:19 +0000
@@ -440,7 +440,7 @@
440440
441 total = 0.0441 total = 0.0
442 results2 = 0.0442 results2 = 0.0
443 443
444 for r in results:444 for r in results:
445 amount = pool_uom._compute_qty(cr, uid, r['product_uom'], r['product_qty'], context.get('uom', False))445 amount = pool_uom._compute_qty(cr, uid, r['product_uom'], r['product_qty'], context.get('uom', False))
446 results2 += amount446 results2 += amount
@@ -2257,7 +2257,7 @@
2257 new_move = self.copy(cr, uid, move.id, default_val)2257 new_move = self.copy(cr, uid, move.id, default_val)
22582258
2259 res += [new_move]2259 res += [new_move]
2260 2260
2261 for (id, name) in product_obj.name_get(cr, uid, [move.product_id.id]):2261 for (id, name) in product_obj.name_get(cr, uid, [move.product_id.id]):
2262 self.log(cr, uid, move.id, "%s x %s %s" % (move.product_qty, name, _("were scrapped")))2262 self.log(cr, uid, move.id, "%s x %s %s" % (move.product_qty, name, _("were scrapped")))
22632263
@@ -2365,7 +2365,8 @@
2365 }2365 }
2366 if (not move.prodlot_id.id) and (move.product_id.track_production and location_id):2366 if (not move.prodlot_id.id) and (move.product_id.track_production and location_id):
2367 # IF product has checked track for production lot, move lines will be split by 12367 # IF product has checked track for production lot, move lines will be split by 1
2368 res += self.action_split(cr, uid, [move.id], quantity, split_by_qty=1, context=context)2368 split_by_qty = context.get('product_qty',1)
2369 res += self.action_split(cr, uid, [move.id], quantity, split_by_qty=split_by_qty, context=context)
2369 else:2370 else:
2370 current_move = self.copy(cr, uid, move.id, default_val)2371 current_move = self.copy(cr, uid, move.id, default_val)
2371 res += [current_move]2372 res += [current_move]
@@ -2378,7 +2379,8 @@
2378 quantity_rest = quantity2379 quantity_rest = quantity
2379 uos_qty_rest = uos_qty2380 uos_qty_rest = uos_qty
2380 if (not move.prodlot_id.id) and (move.product_id.track_production and location_id):2381 if (not move.prodlot_id.id) and (move.product_id.track_production and location_id):
2381 res += self.action_split(cr, uid, [move.id], quantity_rest, split_by_qty=1, context=context)2382 split_by_qty = context.get('product_qty',1)
2383 res += self.action_split(cr, uid, [move.id], quantity_rest, split_by_qty=split_by_qty, context=context)
2382 else:2384 else:
2383 res += [move.id]2385 res += [move.id]
2384 update_val = {2386 update_val = {
23852387
=== modified file 'stock/wizard/stock_move.py'
--- stock/wizard/stock_move.py 2011-04-01 05:25:48 +0000
+++ stock/wizard/stock_move.py 2011-05-23 13:36:19 +0000
@@ -23,6 +23,8 @@
2323
24import decimal_precision as dp24import decimal_precision as dp
2525
26from tools.translate import _
27
26class stock_move_track(osv.osv_memory):28class stock_move_track(osv.osv_memory):
27 _name = "stock.move.track"29 _name = "stock.move.track"
28 _description = "Track moves"30 _description = "Track moves"
@@ -60,7 +62,9 @@
60 'product_id': fields.many2one('product.product', 'Product', required=True, select=True),62 'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
61 'product_qty': fields.float('Quantity', required=True),63 'product_qty': fields.float('Quantity', required=True),
62 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),64 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
63 'location_id': fields.many2one('stock.location', 'Location', required=True)65 'location_id': fields.many2one('stock.location', 'Location', required=True),
66 'prod_lot_id': fields.many2one('stock.production.lot','Production Lot'),
67 'track': fields.boolean('Track')
64 }68 }
6569
66 def default_get(self, cr, uid, fields, context=None):70 def default_get(self, cr, uid, fields, context=None):
@@ -75,15 +79,20 @@
75 if context is None:79 if context is None:
76 context = {}80 context = {}
77 res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)81 res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
78 move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)82
79 if 'product_id' in fields:83 if context.get('active_id'):
80 res.update({'product_id': move.product_id.id})84 move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
81 if 'product_uom' in fields:85 if 'product_id' in fields:
82 res.update({'product_uom': move.product_uom.id})86 res.update({'product_id': move.product_id.id})
83 if 'product_qty' in fields:87 if 'product_uom' in fields:
84 res.update({'product_qty': move.product_qty})88 res.update({'product_uom': move.product_uom.id})
85 if 'location_id' in fields:89 if 'product_qty' in fields:
86 res.update({'location_id': move.location_id.id})90 res.update({'product_qty': move.product_qty})
91 if 'location_id' in fields:
92 res.update({'location_id': move.location_id.id})
93 if 'prod_lot_id' in fields:
94 res.update({'prod_lot_id': move.prodlot_id.id})
95 res.update({'track': move.product_id.track_production})
8796
88 return res97 return res
8998
@@ -99,11 +108,22 @@
99 if context is None:108 if context is None:
100 context = {}109 context = {}
101 move_obj = self.pool.get('stock.move')110 move_obj = self.pool.get('stock.move')
102 move_ids = context['active_ids']111 data = self.browse(cr, uid, ids[0], context=context)
103 for data in self.read(cr, uid, ids):112
104 move_obj.action_consume(cr, uid, move_ids,113 if context.get('active_id'):
105 data['product_qty'], data['location_id'],114 stock_move = move_obj.browse(cr, uid, context['active_id'], context=context)
115
116 if stock_move.product_qty < data.product_qty:
117 raise osv.except_osv(_('User Error!'),_('Cannot consume more quantity of products than available!'))
118
119 if stock_move.prodlot_id != data.prod_lot_id:
120 move_obj.write(cr, uid, [stock_move.id], {'prodlot_id': data.prod_lot_id.id}, context=context)
121
122 context.update({'product_qty': data.product_qty})
123 move_obj.action_consume(cr, uid, [stock_move.id],
124 data.product_qty, data.location_id.id,
106 context=context)125 context=context)
126
107 return {'type': 'ir.actions.act_window_close'}127 return {'type': 'ir.actions.act_window_close'}
108128
109stock_move_consume()129stock_move_consume()
110130
=== modified file 'stock/wizard/stock_move_view.xml'
--- stock/wizard/stock_move_view.xml 2011-01-14 00:11:01 +0000
+++ stock/wizard/stock_move_view.xml 2011-05-23 13:36:19 +0000
@@ -43,6 +43,8 @@
43 <field name="location_id" colspan="4" />43 <field name="location_id" colspan="4" />
44 <field name="product_qty" colspan="2"/>44 <field name="product_qty" colspan="2"/>
45 <field name="product_uom" nolabel="1" readonly="1"/>45 <field name="product_uom" nolabel="1" readonly="1"/>
46 <field name="prod_lot_id" attrs="{'required':[('track','=',True)]}" domain="[('product_id','=',product_id)]"/>
47 <field name="track" invisible="1"/>
46 <newline/>48 <newline/>
47 <separator string="" colspan="4" />49 <separator string="" colspan="4" />
48 <label string="" colspan="2" />50 <label string="" colspan="2" />