[IMP] convert applicant to employee: name
[odoo/odoo.git] / addons / account_anglo_saxon / purchase.py
index f08cc08..959f8b7 100644 (file)
@@ -19,7 +19,7 @@
 #
 ##############################################################################
 
-from osv import fields, osv
+from openerp.osv import fields, osv
 
 class purchase_order(osv.osv):
     _name = "purchase.order"
@@ -30,7 +30,7 @@ class purchase_order(osv.osv):
         line = super(purchase_order, self)._prepare_inv_line(cr, uid, account_id, order_line, context=context)
         if order_line.product_id and not order_line.product_id.type == 'service':
             acc_id = order_line.product_id.property_stock_account_input and order_line.product_id.property_stock_account_input.id
-            if not oa:
+            if not acc_id:
                 acc_id = order_line.product_id.categ_id.property_stock_account_input_categ and order_line.product_id.categ_id.property_stock_account_input_categ.id
             if acc_id:
                 fpos = order_line.order_id.fiscal_position or False
@@ -38,3 +38,5 @@ class purchase_order(osv.osv):
                 line.update({'account_id': new_account_id})
         return line
 purchase_order()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: