← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-716107-ron into lp:openobject-addons

 

Rohan Nayani(openerp) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-716107-ron into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  #716107 [PS] analytic line : adding product doesn't add the unit of measure
  https://bugs.launchpad.net/bugs/716107

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-716107-ron/+merge/50566

https://bugs.launchpad.net/openobject-addons/+bug/716107
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-716107-ron/+merge/50566
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-716107-ron.
=== modified file 'account/account_analytic_line.py'
--- account/account_analytic_line.py	2011-01-14 00:11:01 +0000
+++ account/account_analytic_line.py	2011-02-21 09:17:02 +0000
@@ -80,7 +80,11 @@
         j_id = analytic_journal_obj.browse(cr, uid, journal_id, context=context)
         prod = product_obj.browse(cr, uid, prod_id, context=context)
         result = 0.0
-
+        product_uom_id=False
+        if prod_id:
+            product_uom_id = prod.uom_id.id
+            if j_id.type == 'purchase':
+                product_uom_id = prod.uom_po_id.id
         if j_id.type <> 'sale':
             a = prod.product_tmpl_id.property_account_expense.id
             if not a:
@@ -127,6 +131,7 @@
         return {'value': {
             'amount': result,
             'general_account_id': a,
+            'product_uom_id':product_uom_id
             }
         }
 


Follow ups