Hiral Patel (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-1098514-hip into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #1098514 in OpenERP Addons: "invoicing an order as a fixed price or 
percentage deposit doesn’t work"
  https://bugs.launchpad.net/openobject-addons/+bug/1098514

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1098514-hip/+merge/144884
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1098514-hip/+merge/144884
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-1098514-hip.
=== modified file 'account_analytic_default/account_analytic_default.py'
--- account_analytic_default/account_analytic_default.py	2012-12-21 16:48:08 +0000
+++ account_analytic_default/account_analytic_default.py	2013-01-25 10:17:25 +0000
@@ -73,8 +73,8 @@
     _inherit = "account.invoice.line"
     _description = "Invoice Line"
 
-    def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
-        res_prod = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, currency_id=currency_id, context=context, company_id=company_id)
+    def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
+        res_prod = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty, name, type, partner_id, fposition_id, price_unit, currency_id=currency_id, context=context, company_id=company_id)
         rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context=context)
         if rec:
             res_prod['value'].update({'account_analytic_id': rec.analytic_id.id})

=== modified file 'account_analytic_plans/account_analytic_plans.py'
--- account_analytic_plans/account_analytic_plans.py	2012-12-06 14:56:32 +0000
+++ account_analytic_plans/account_analytic_plans.py	2013-01-25 10:17:25 +0000
@@ -308,8 +308,8 @@
         res ['analytics_id'] = line.analytics_id and line.analytics_id.id or False
         return res
 
-    def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
-        res_prod = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, currency_id, context=context, company_id=company_id)
+    def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
+        res_prod = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty, name, type, partner_id, fposition_id, price_unit, currency_id, context=context, company_id=company_id)
         rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context=context)
         if rec and rec.analytics_id:
             res_prod['value'].update({'analytics_id': rec.analytics_id.id})

=== modified file 'account_anglo_saxon/invoice.py'
--- account_anglo_saxon/invoice.py	2012-12-19 01:04:29 +0000
+++ account_anglo_saxon/invoice.py	2013-01-25 10:17:25 +0000
@@ -136,9 +136,9 @@
                         res += diff_res
         return res
 
-    def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
+    def product_id_change(self, cr, uid, ids, product, uom_ud, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
         fiscal_pool = self.pool.get('account.fiscal.position')
-        res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, currency_id, context, company_id)
+        res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty, name, type, partner_id, fposition_id, price_unit, currency_id, context, company_id)
         if not product:
             return res
         if type in ('in_invoice','in_refund'):

=== modified file 'product_visible_discount/product_visible_discount.py'
--- product_visible_discount/product_visible_discount.py	2012-12-06 14:56:32 +0000
+++ product_visible_discount/product_visible_discount.py	2013-01-25 10:17:25 +0000
@@ -100,10 +100,10 @@
 class account_invoice_line(osv.osv):
     _inherit = "account.invoice.line"
 
-    def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
-        res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit,currency_id, context=context, company_id=company_id)
+    def product_id_change(self, cr, uid, ids, product, uom_id, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, currency_id=False, context=None, company_id=None):
+        res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom_id, qty, name, type, partner_id, fposition_id, price_unit,currency_id, context=context, company_id=company_id)
 
-        def get_real_price(res_dict, product_id, qty, uom, pricelist):
+        def get_real_price(res_dict, product_id, qty, uom_id, pricelist):
             item_obj = self.pool.get('product.pricelist.item')
             price_type_obj = self.pool.get('product.price.type')
             product_obj = self.pool.get('product.product')
@@ -121,7 +121,7 @@
             product_read = product_obj.read(cr, uid, product_id, [field_name], context=context)
 
             factor = 1.0
-            if uom and uom != product.uom_id.id:
+            if uom_id and uom_id != product.uom_id.id:
                 product_uom_obj = self.pool.get('product.uom')
                 uom_data = product_uom_obj.browse(cr, uid,  product.uom_id.id)
                 factor = uom_data.factor
@@ -139,18 +139,18 @@
                     pricelist =partner_obj.browse(cr, uid, partner_id).property_product_pricelist_purchase.id
                     if not pricelist:
                         raise osv.except_osv(_('No Purchase Pricelist Found!'),_("You must first define a pricelist on the supplier form!"))
-                    price_unit_res = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom})
+                    price_unit_res = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom_id})
                     price_unit = price_unit_res[pricelist]
-                    real_price = get_real_price(price_unit_res, product.id, qty, uom, pricelist)
+                    real_price = get_real_price(price_unit_res, product.id, qty, uom_id, pricelist)
             else:
                 if partner_id:
                     pricelist = partner_obj.browse(cr, uid, partner_id).property_product_pricelist.id
                     if not pricelist:
                         raise osv.except_osv(_('No Sale Pricelist Found!'),_("You must first define a pricelist on the customer form!"))
-                    price_unit_res = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom})
+                    price_unit_res = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom_id})
                     price_unit = price_unit_res[pricelist]
 
-                    real_price = get_real_price(price_unit_res, product.id, qty, uom, pricelist)
+                    real_price = get_real_price(price_unit_res, product.id, qty, uom_id, pricelist)
             if pricelist:
                 pricelists=pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
                 if(len(pricelists)>0 and pricelists[0]['visible_discount'] and real_price != 0):

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to