diff --git a/addons/account_anglo_saxon/invoice.py b/addons/account_anglo_saxon/invoice.py index e4ea2adb748..5465edf380d 100644 --- a/addons/account_anglo_saxon/invoice.py +++ b/addons/account_anglo_saxon/invoice.py @@ -50,14 +50,9 @@ class account_invoice_line(osv.osv): return res if type in ('in_invoice','in_refund'): product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context) - if type == 'in_invoice': - oa = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id - if not oa: - oa = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id - else: - oa = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id - if not oa: - oa = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id + oa = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id + if not oa: + oa = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id if oa: fpos = fposition_id and fiscal_pool.browse(cr, uid, fposition_id, context=context) or False a = fiscal_pool.map_account(cr, uid, fpos, oa) diff --git a/addons/account_anglo_saxon/stock.py b/addons/account_anglo_saxon/stock.py index 2b40bb67cf3..e646bb17c0d 100644 --- a/addons/account_anglo_saxon/stock.py +++ b/addons/account_anglo_saxon/stock.py @@ -41,19 +41,7 @@ class stock_picking(osv.osv): group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' res = super(stock_picking,self).action_invoice_create(cr, uid, ids, journal_id, group, type, context=context) - if type == 'in_refund': - for inv in self.pool.get('account.invoice').browse(cr, uid, res, context=context): - for ol in inv.invoice_line: - if ol.product_id: - oa = ol.product_id.property_stock_account_output and ol.product_id.property_stock_account_output.id - if not oa: - oa = ol.product_id.categ_id.property_stock_account_output_categ and ol.product_id.categ_id.property_stock_account_output_categ.id - if oa: - fpos = ol.invoice_id.fiscal_position or False - a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, oa) - self.pool.get('account.invoice.line').write(cr, uid, [ol.id], {'account_id': a}) - - elif type == 'in_invoice': + if type in ('in_invoice', 'in_refund'): for inv in self.pool.get('account.invoice').browse(cr, uid, res, context=context): for ol in inv.invoice_line: if ol.product_id: