Merge lp:~openerp-dev/openobject-addons/trunk-bug-1085253-tta into lp:openobject-addons

Proposed by SnippetBucket.com
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1085253-tta
Merge into: lp:openobject-addons
Diff against target: 22 lines (+12/-0)
1 file modified
stock/stock.py (+12/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1085253-tta
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+141312@code.launchpad.net

Description of the change

Hello,

Fixed Bug: 1085253

 * inventory - missing check line.UoM must be in category of product.UoM .

 * Reported Bug: https://bugs.launchpad.net/openobject-addons/+bug/1085253

Thanks,
tta

To post a comment you must log in.

Unmerged revisions

8483. By SnippetBucket.com

[FIX] bug: 1085253, 7.0 inventory - missing check line.UoM must be in category of product.UoM.

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-21 16:48:08 +0000
3+++ stock/stock.py 2012-12-27 09:50:43 +0000
4@@ -2886,6 +2886,18 @@
5 'location_id': _default_stock_location
6 }
7
8+ def _check_uom(self, cr, uid, ids, context=None):
9+ for records in self.browse(cr, uid, ids, context=context):
10+ if records.product_id.uom_id.category_id.id != records.product_uom.category_id.id:
11+ return False
12+ else:
13+ return True
14+
15+ _constraints = [
16+ (_check_uom,
17+ 'You must assign appropriate uom for this product.',
18+ ['product_uom']),]
19+
20 def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False, to_date=False):
21 """ Changes UoM and name if product_id changes.
22 @param location_id: Location id

Subscribers

People subscribed via source and target branches

to all changes: