Merge lp:~openerp-dev/openobject-addons/7.0-opw-586615-pna into lp:openobject-addons/7.0

Proposed by Pinakin Nayi (OpenERP)
Status: Work in progress
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-586615-pna
Merge into: lp:openobject-addons/7.0
Diff against target: 26 lines (+9/-0)
1 file modified
procurement/procurement.py (+9/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-586615-pna
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Needs Fixing
Review via email: mp+150766@code.launchpad.net

Description of the change

Hello ,

I Fixed issue in procurement module for reordering rules and add constraint to restrict qty.

Steps to reproduce :
Create Reordering rules for product, now enter minimum qty more than maximum qty it will save it without warning.

Expected Result :
Not allowing minimum qty more than maximum qty.

Thanks,
pna

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hi,

Please remove the changes concerning the *.pot. The terms should not be added manually in these files, they are meant to be automatically created on each re-synchronization of the translation templates.

Thanks,
Naresh Soni
OpenERP Enterprise Services

review: Needs Fixing
8774. By Pinakin Nayi (OpenERP)

[REV]procurement: remove unwanted pot changes

8775. By Pinakin Nayi (OpenERP)

[REV]procurement: remove unwanted pot changes

Revision history for this message
Pinakin Nayi (OpenERP) (pna-openerp) wrote :

Hello Sir,

I just removed unwanted *.pot changes as per suggestion.

Thanks,
pna

Unmerged revisions

8775. By Pinakin Nayi (OpenERP)

[REV]procurement: remove unwanted pot changes

8774. By Pinakin Nayi (OpenERP)

[REV]procurement: remove unwanted pot changes

8773. By Pinakin Nayi (OpenERP)

[IMP]procurement:whem set reordering rules it takes min qty more than max qty so add constraint

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'procurement/procurement.py'
2--- procurement/procurement.py 2013-06-07 11:38:29 +0000
3+++ procurement/procurement.py 2013-06-17 12:52:43 +0000
4@@ -510,6 +510,14 @@
5
6 return True
7
8+ def _check_product_qty(self, cr, uid, ids, context=None):
9+ if not context:
10+ context = {}
11+ for rule in self.browse(cr, uid, ids, context=context):
12+ if rule.product_min_qty > rule.product_max_qty :
13+ return False
14+ return True
15+
16 _columns = {
17 'name': fields.char('Name', size=32, required=True),
18 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the orderpoint without removing it."),
19@@ -544,6 +552,7 @@
20 ]
21 _constraints = [
22 (_check_product_uom, 'You have to select a product unit of measure in the same category than the default unit of measure of the product', ['product_id', 'product_uom']),
23+ (_check_product_qty, 'Please verify the minimum quantity should not be more than maximum quantity', ['product_min_qty', 'product_max_qty']),
24 ]
25
26 def default_get(self, cr, uid, fields, context=None):