From 255bf5806a57937e3e986296236053acd8fcdb64 Mon Sep 17 00:00:00 2001
From: "ron@tinyerp.com" <>
Date: Thu, 18 Nov 2010 17:36:27 +0530
Subject: [PATCH 01/10] [IMP]: purchase: Improvment in code product supplier
code name display in purchase line
bzr revid: ron@tinyerp.com-20101118120627-7150ordmsx038omu
---
addons/purchase/purchase.py | 30 +++++++++++++++++-------------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index d93a1ec15b1..80ba39d9f35 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -646,10 +646,7 @@ class purchase_order_line(osv.osv):
return {'value': {'price_unit': price_unit or 0.0, 'name': name or '',
'notes': notes or'', 'product_uom' : uom or False}, 'domain':{'product_uom':[]}}
prod= self.pool.get('product.product').browse(cr, uid, product)
- if prod.product_tmpl_id.seller_ids:
- seller_get_id = prod.product_tmpl_id.seller_ids[0].name.id
- else:
- seller_get_id = False
+
lang=False
if partner_id:
@@ -680,15 +677,22 @@ class purchase_order_line(osv.osv):
'date': date_order,
})[pricelist]
dt = (datetime.now() + relativedelta(days=int(seller_delay) or 0.0)).strftime('%Y-%m-%d %H:%M:%S')
- if seller_get_id == partner_id:
- prod_suppl_name = self.pool.get('product.product').browse(cr, uid, prod.id).seller_ids[0].product_name
- prod_suppl_code = self.pool.get('product.product').browse(cr, uid, prod.id).seller_ids[0].product_code
- if prod_suppl_name == False or prod_suppl_code == False:
- prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
- else:
- prod_name= '[' + prod_suppl_code + '] '+ prod_suppl_name
- else:
- prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
+
+ seller_get_id = False
+
+ prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
+
+ for seller_id in prod.product_tmpl_id.seller_ids:
+ if seller_id.name.id == partner_id:
+ prod_suppl_name = seller_id.product_name
+ prod_suppl_code = seller_id.product_code
+ if not (prod_suppl_name or prod_suppl_code):
+ prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
+ elif (not prod_suppl_name) or (not prod_suppl_code):
+ prod_name= '[' + (prod_suppl_code or prod.default_code or '') + '] '+ (prod_suppl_name or prod.name or '')
+ else:
+ prod_name= '[' + prod_suppl_code + '] '+ prod_suppl_name
+
res = {'value': {'price_unit': price, 'name': name or prod_name,
'taxes_id':map(lambda x: x.id, prod.supplier_taxes_id),
From b5a5314fc04d61ab83492056ce06e712ec4d54c9 Mon Sep 17 00:00:00 2001
From: "ron@tinyerp.com" <>
Date: Thu, 18 Nov 2010 19:01:57 +0530
Subject: [PATCH 02/10] [IMP]Add Button Print delivery order and Return
Product in Delivery Module .lp BUG:-674578
bzr revid: ron@tinyerp.com-20101118133157-s8w7i43mjbuqxcx4
---
addons/delivery/delivery_report.xml | 3 ++-
addons/delivery/delivery_view.xml | 19 ++++++++++++++++++-
addons/stock/stock_view.xml | 2 +-
.../wizard/stock_return_picking_view.xml | 11 ++++++-----
4 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/addons/delivery/delivery_report.xml b/addons/delivery/delivery_report.xml
index 14c1d241131..3cebbba4eac 100644
--- a/addons/delivery/delivery_report.xml
+++ b/addons/delivery/delivery_report.xml
@@ -6,7 +6,8 @@
id="report_shipping"
model="stock.picking"
name="sale.shipping"
- rml="delivery/report/shipping.rml"
+ multi="True"
+ rml="delivery/report/shipping.rml"
string="Delivery order"/>
diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml
index b7ec0fed61e..59e58c4f97b 100644
--- a/addons/delivery/delivery_view.xml
+++ b/addons/delivery/delivery_view.xml
@@ -4,6 +4,9 @@
+
+
+
delivery.carrier.tree
delivery.carrier
@@ -266,10 +269,24 @@
-
+
+
+ stock.picking.out.form
+ form
+ stock.picking
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 61bc8b887de..a1e3e01fca7 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -911,7 +911,7 @@
-
+
diff --git a/addons/stock/wizard/stock_return_picking_view.xml b/addons/stock/wizard/stock_return_picking_view.xml
index 36a7c23a66f..3f4f2d296d9 100644
--- a/addons/stock/wizard/stock_return_picking_view.xml
+++ b/addons/stock/wizard/stock_return_picking_view.xml
@@ -1,12 +1,13 @@
-
+ target="new"
+ key2="client_action_multi"
+ multi="True"
+ id="act_stock_return_picking"/>
-
+
From 5b647eb30c82b1f3eed3a549ecc08069f0858647 Mon Sep 17 00:00:00 2001
From: "ron@tinyerp.com" <>
Date: Fri, 19 Nov 2010 15:35:51 +0530
Subject: [PATCH 03/10] [FIX]Product:EAN code validation fails
lp bug: https://launchpad.net/bugs/606325 fixed
bzr revid: ron@tinyerp.com-20101119100551-gwmlsdp1md2b7z93
---
addons/product/product.py | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/addons/product/product.py b/addons/product/product.py
index 002add587ee..c3df5c76e3e 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -430,7 +430,7 @@ class product_product(osv.osv):
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the product without removing it."),
'variants': fields.char('Variants', size=64),
'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade"),
- 'ean13': fields.char('EAN13', size=13),
+ 'ean13': fields.char('EAN13', size=14),
'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."),
'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Sale Price')),
'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Sale Price')),
@@ -450,20 +450,29 @@ class product_product(osv.osv):
for partner in self.browse(cr, uid, ids):
if not partner.ean13:
continue
- if len(partner.ean13) <> 13:
+ if len(partner.ean13) not in [13,14,8]:
return False
try:
int(partner.ean13)
except:
return False
- sum=0
- for i in range(12):
+ oddsum=0
+ evensum=0
+ total=0
+ eanvalue=partner.ean13
+ reversevalue = eanvalue[::-1]
+ finalean=reversevalue[1:]
+
+ for i in range(len(finalean)):
if is_pair(i):
- sum += int(partner.ean13[i])
+ oddsum += int(finalean[i])
else:
- sum += 3 * int(partner.ean13[i])
- check = int(math.ceil(sum / 10.0) * 10 - sum)
- if check != int(partner.ean13[12]):
+ evensum += int(finalean[i])
+ total=(oddsum * 3) + evensum
+
+ check = int(10 - math.ceil(total % 10.0))
+
+ if check != int(partner.ean13[-1]):
return False
return True
From 05a612012c00d1880266fc26fdf83943ff821296 Mon Sep 17 00:00:00 2001
From: "ron@tinyerp.com" <>
Date: Fri, 19 Nov 2010 18:32:08 +0530
Subject: [PATCH 04/10] [IMP]Product:EAN code validation check on
product_packaging bug:606325
bzr revid: ron@tinyerp.com-20101119130208-u6akfv119p6n0lnu
---
addons/product/product.py | 65 +++++++++++++++++++++++----------------
1 file changed, 38 insertions(+), 27 deletions(-)
diff --git a/addons/product/product.py b/addons/product/product.py
index c3df5c76e3e..aa931c20916 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -30,6 +30,34 @@ from tools.translate import _
def is_pair(x):
return not x%2
+def check_ean(ean_code):
+ if not ean_code:
+ return True
+ if len(ean_code) not in [13,14,8]:
+ return False
+ try:
+ int(ean_code)
+ except:
+ return False
+ oddsum=0
+ evensum=0
+ total=0
+ eanvalue=ean_code
+ reversevalue = eanvalue[::-1]
+ finalean=reversevalue[1:]
+
+ for i in range(len(finalean)):
+ if is_pair(i):
+ oddsum += int(finalean[i])
+ else:
+ evensum += int(finalean[i])
+ total=(oddsum * 3) + evensum
+
+ check = int(10 - math.ceil(total % 10.0))
+
+ if check != int(ean_code[-1]):
+ return False
+ return True
#----------------------------------------------------------
# UOM
#----------------------------------------------------------
@@ -448,33 +476,8 @@ class product_product(osv.osv):
def _check_ean_key(self, cr, uid, ids):
for partner in self.browse(cr, uid, ids):
- if not partner.ean13:
- continue
- if len(partner.ean13) not in [13,14,8]:
- return False
- try:
- int(partner.ean13)
- except:
- return False
- oddsum=0
- evensum=0
- total=0
- eanvalue=partner.ean13
- reversevalue = eanvalue[::-1]
- finalean=reversevalue[1:]
-
- for i in range(len(finalean)):
- if is_pair(i):
- oddsum += int(finalean[i])
- else:
- evensum += int(finalean[i])
- total=(oddsum * 3) + evensum
-
- check = int(10 - math.ceil(total % 10.0))
-
- if check != int(partner.ean13[-1]):
- return False
- return True
+ res = check_ean(partner.ean13)
+ return res
_constraints = [(_check_ean_key, 'Error: Invalid ean code', ['ean13'])]
@@ -604,6 +607,14 @@ class product_packaging(osv.osv):
}
+ def _check_ean_key_r(self, cr, uid, ids):
+ for partner in self.browse(cr, uid, ids):
+ res = check_ean(partner.ean)
+ return res
+
+ _constraints = [(_check_ean_key_r, 'Error: Invalid ean code', ['ean'])]
+
+
def name_get(self, cr, uid, ids, context={}):
if not len(ids):
return []
From 7a502da18682a5d163dec1767ee7b003aac66754 Mon Sep 17 00:00:00 2001
From: "ron@tinyerp.com" <>
Date: Mon, 22 Nov 2010 16:39:17 +0530
Subject: [PATCH 05/10] [IMP]product:EAN Code check Function Improvment
bzr revid: ron@tinyerp.com-20101122110917-1eafwg0o36du4puz
---
addons/product/product.py | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/addons/product/product.py b/addons/product/product.py
index 471ac4dda2e..a636d5d64fe 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -30,19 +30,19 @@ from tools.translate import _
def is_pair(x):
return not x%2
-def check_ean(ean_code):
- if not ean_code:
+def check_ean(eancode):
+ if not eancode:
return True
- if len(ean_code) not in [13,14,8]:
+ if len(eancode) not in [13,14,8]:
return False
try:
- int(ean_code)
+ int(eancode)
except:
return False
oddsum=0
evensum=0
total=0
- eanvalue=ean_code
+ eanvalue=eancode
reversevalue = eanvalue[::-1]
finalean=reversevalue[1:]
@@ -55,7 +55,7 @@ def check_ean(ean_code):
check = int(10 - math.ceil(total % 10.0))
- if check != int(ean_code[-1]):
+ if check != int(eancode[-1]):
return False
return True
#----------------------------------------------------------
@@ -481,7 +481,8 @@ class product_product(osv.osv):
def _check_ean_key(self, cr, uid, ids):
for partner in self.browse(cr, uid, ids):
- res = check_ean(partner.ean13)
+ eancheck = partner.ean13
+ res = check_ean( eancheck )
return res
_constraints = [(_check_ean_key, 'Error: Invalid ean code', ['ean13'])]
@@ -614,7 +615,8 @@ class product_packaging(osv.osv):
def _check_ean_key_r(self, cr, uid, ids):
for partner in self.browse(cr, uid, ids):
- res = check_ean(partner.ean)
+ eancheckp = partner.ean
+ res = check_ean(eancheckp)
return res
_constraints = [(_check_ean_key_r, 'Error: Invalid ean code', ['ean'])]
From 327be90e0c43647219003256b296f1fe93ef572a Mon Sep 17 00:00:00 2001
From: "ron@tinyerp.com" <>
Date: Mon, 22 Nov 2010 16:55:03 +0530
Subject: [PATCH 06/10] [FIX]Incomming Shippment:Group By Partner Problem
lp bug: https://launchpad.net/bugs/670921 fixed
bzr revid: ron@tinyerp.com-20101122112503-nd6bykbglmojdo91
---
addons/stock/stock_view.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 5b452478582..c80fce972ef 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -786,7 +786,7 @@
-
+
From 68e8e0caecfb20ad56e8cbcb4bc4fd2dd50096b1 Mon Sep 17 00:00:00 2001
From: "ron@tinyerp.com" <>
Date: Mon, 22 Nov 2010 18:46:15 +0530
Subject: [PATCH 07/10] [IMP]Improvement in Code
bzr revid: ron@tinyerp.com-20101122131615-l4c5xxidfsokhdvs
---
addons/product/product.py | 4 ++--
addons/stock/stock_view.xml | 1 +
addons/stock/wizard/stock_invoice_onshipping.py | 3 +--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/addons/product/product.py b/addons/product/product.py
index a636d5d64fe..d810ea8e01f 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -33,7 +33,7 @@ def is_pair(x):
def check_ean(eancode):
if not eancode:
return True
- if len(eancode) not in [13,14,8]:
+ if len(eancode) not in [13]:
return False
try:
int(eancode)
@@ -463,7 +463,7 @@ class product_product(osv.osv):
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the product without removing it."),
'variants': fields.char('Variants', size=64),
'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade"),
- 'ean13': fields.char('EAN13', size=14),
+ 'ean13': fields.char('EAN13', size=13),
'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."),
'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Sale Price')),
'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Sale Price')),
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index c80fce972ef..4ef592bd3fd 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -875,6 +875,7 @@
+