Merge lp:~openerp-dev/openobject-addons/6.0-opw-4972-improved-ach into lp:openobject-addons/6.0
- 6.0-opw-4972-improved-ach
- Merge into 6.0
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jacques-Etienne Baudoux | Pending | ||
Jay Vora (Serpent Consulting Services) | Pending | ||
Review via email: mp+59026@code.launchpad.net |
Commit message
Description of the change
Hello Jay,
I have improved the wizard and other functionalities.
Thanks.
- 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
1 | === modified file 'stock/stock.py' |
2 | --- stock/stock.py 2011-05-18 15:40:44 +0000 |
3 | +++ stock/stock.py 2011-05-23 13:36:19 +0000 |
4 | @@ -440,7 +440,7 @@ |
5 | |
6 | total = 0.0 |
7 | results2 = 0.0 |
8 | - |
9 | + |
10 | for r in results: |
11 | amount = pool_uom._compute_qty(cr, uid, r['product_uom'], r['product_qty'], context.get('uom', False)) |
12 | results2 += amount |
13 | @@ -2257,7 +2257,7 @@ |
14 | new_move = self.copy(cr, uid, move.id, default_val) |
15 | |
16 | res += [new_move] |
17 | - |
18 | + |
19 | for (id, name) in product_obj.name_get(cr, uid, [move.product_id.id]): |
20 | self.log(cr, uid, move.id, "%s x %s %s" % (move.product_qty, name, _("were scrapped"))) |
21 | |
22 | @@ -2365,7 +2365,8 @@ |
23 | } |
24 | if (not move.prodlot_id.id) and (move.product_id.track_production and location_id): |
25 | # IF product has checked track for production lot, move lines will be split by 1 |
26 | - res += self.action_split(cr, uid, [move.id], quantity, split_by_qty=1, context=context) |
27 | + split_by_qty = context.get('product_qty',1) |
28 | + res += self.action_split(cr, uid, [move.id], quantity, split_by_qty=split_by_qty, context=context) |
29 | else: |
30 | current_move = self.copy(cr, uid, move.id, default_val) |
31 | res += [current_move] |
32 | @@ -2378,7 +2379,8 @@ |
33 | quantity_rest = quantity |
34 | uos_qty_rest = uos_qty |
35 | if (not move.prodlot_id.id) and (move.product_id.track_production and location_id): |
36 | - res += self.action_split(cr, uid, [move.id], quantity_rest, split_by_qty=1, context=context) |
37 | + split_by_qty = context.get('product_qty',1) |
38 | + res += self.action_split(cr, uid, [move.id], quantity_rest, split_by_qty=split_by_qty, context=context) |
39 | else: |
40 | res += [move.id] |
41 | update_val = { |
42 | |
43 | === modified file 'stock/wizard/stock_move.py' |
44 | --- stock/wizard/stock_move.py 2011-04-01 05:25:48 +0000 |
45 | +++ stock/wizard/stock_move.py 2011-05-23 13:36:19 +0000 |
46 | @@ -23,6 +23,8 @@ |
47 | |
48 | import decimal_precision as dp |
49 | |
50 | +from tools.translate import _ |
51 | + |
52 | class stock_move_track(osv.osv_memory): |
53 | _name = "stock.move.track" |
54 | _description = "Track moves" |
55 | @@ -60,7 +62,9 @@ |
56 | 'product_id': fields.many2one('product.product', 'Product', required=True, select=True), |
57 | 'product_qty': fields.float('Quantity', required=True), |
58 | 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True), |
59 | - 'location_id': fields.many2one('stock.location', 'Location', required=True) |
60 | + 'location_id': fields.many2one('stock.location', 'Location', required=True), |
61 | + 'prod_lot_id': fields.many2one('stock.production.lot','Production Lot'), |
62 | + 'track': fields.boolean('Track') |
63 | } |
64 | |
65 | def default_get(self, cr, uid, fields, context=None): |
66 | @@ -75,15 +79,20 @@ |
67 | if context is None: |
68 | context = {} |
69 | res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context) |
70 | - move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context) |
71 | - if 'product_id' in fields: |
72 | - res.update({'product_id': move.product_id.id}) |
73 | - if 'product_uom' in fields: |
74 | - res.update({'product_uom': move.product_uom.id}) |
75 | - if 'product_qty' in fields: |
76 | - res.update({'product_qty': move.product_qty}) |
77 | - if 'location_id' in fields: |
78 | - res.update({'location_id': move.location_id.id}) |
79 | + |
80 | + if context.get('active_id'): |
81 | + move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context) |
82 | + if 'product_id' in fields: |
83 | + res.update({'product_id': move.product_id.id}) |
84 | + if 'product_uom' in fields: |
85 | + res.update({'product_uom': move.product_uom.id}) |
86 | + if 'product_qty' in fields: |
87 | + res.update({'product_qty': move.product_qty}) |
88 | + if 'location_id' in fields: |
89 | + res.update({'location_id': move.location_id.id}) |
90 | + if 'prod_lot_id' in fields: |
91 | + res.update({'prod_lot_id': move.prodlot_id.id}) |
92 | + res.update({'track': move.product_id.track_production}) |
93 | |
94 | return res |
95 | |
96 | @@ -99,11 +108,22 @@ |
97 | if context is None: |
98 | context = {} |
99 | move_obj = self.pool.get('stock.move') |
100 | - move_ids = context['active_ids'] |
101 | - for data in self.read(cr, uid, ids): |
102 | - move_obj.action_consume(cr, uid, move_ids, |
103 | - data['product_qty'], data['location_id'], |
104 | + data = self.browse(cr, uid, ids[0], context=context) |
105 | + |
106 | + if context.get('active_id'): |
107 | + stock_move = move_obj.browse(cr, uid, context['active_id'], context=context) |
108 | + |
109 | + if stock_move.product_qty < data.product_qty: |
110 | + raise osv.except_osv(_('User Error!'),_('Cannot consume more quantity of products than available!')) |
111 | + |
112 | + if stock_move.prodlot_id != data.prod_lot_id: |
113 | + move_obj.write(cr, uid, [stock_move.id], {'prodlot_id': data.prod_lot_id.id}, context=context) |
114 | + |
115 | + context.update({'product_qty': data.product_qty}) |
116 | + move_obj.action_consume(cr, uid, [stock_move.id], |
117 | + data.product_qty, data.location_id.id, |
118 | context=context) |
119 | + |
120 | return {'type': 'ir.actions.act_window_close'} |
121 | |
122 | stock_move_consume() |
123 | |
124 | === modified file 'stock/wizard/stock_move_view.xml' |
125 | --- stock/wizard/stock_move_view.xml 2011-01-14 00:11:01 +0000 |
126 | +++ stock/wizard/stock_move_view.xml 2011-05-23 13:36:19 +0000 |
127 | @@ -43,6 +43,8 @@ |
128 | <field name="location_id" colspan="4" /> |
129 | <field name="product_qty" colspan="2"/> |
130 | <field name="product_uom" nolabel="1" readonly="1"/> |
131 | + <field name="prod_lot_id" attrs="{'required':[('track','=',True)]}" domain="[('product_id','=',product_id)]"/> |
132 | + <field name="track" invisible="1"/> |
133 | <newline/> |
134 | <separator string="" colspan="4" /> |
135 | <label string="" colspan="2" /> |