diff options
| author | mra (Open ERP) <mra@tinyerp.com> | 2009-01-20 14:18:19 +0530 |
|---|---|---|
| committer | mra (Open ERP) <mra@tinyerp.com> | 2009-01-20 14:18:19 +0530 |
| commit | 7f3bc31bbcac6ff53ebd032e7fa2e6aaac2ec087 (patch) | |
| tree | 5173ab994faf4340cbd52fc34a1b9d3638a971fe /addons/delivery | |
| parent | 804b2e3888a3ece482ff0353155e2c612c376add (diff) | |
fix bug : fiscal position(map_tax,map_account)
bzr revid: mra@tinyerp.com-20090120084819-pdcl2hhuxh6csruu
Diffstat (limited to 'addons/delivery')
| -rw-r--r-- | addons/delivery/stock.py | 6 | ||||
| -rw-r--r-- | addons/delivery/wizard/delivery_sale_order.py | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py index b6d6bd21dbd..3377ff3395e 100644 --- a/addons/delivery/stock.py +++ b/addons/delivery/stock.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # @@ -82,8 +82,8 @@ class stock_picking(osv.osv): taxes_ids = [x.id for x in picking.carrier_id.product_id.taxes_id] if partner_id: partner = picking.address_id.partner_id - account_id = self.pool.get('account.fiscal.position').map_account(cursor, user, partner, account_id) - taxes_ids = self.pool.get('account.fiscal.position').map_tax(cursor, user, partner, taxes) + account_id = self.pool.get('account.fiscal.position').map_account(cursor, user, partner.property_account_position, account_id) + taxes_ids = self.pool.get('account.fiscal.position').map_tax(cursor, user, partner.property_account_position, taxes) invoice_line_obj.create(cursor, user, { 'name': picking.carrier_id.name, diff --git a/addons/delivery/wizard/delivery_sale_order.py b/addons/delivery/wizard/delivery_sale_order.py index 3be4dae67cf..b0bda72dabd 100644 --- a/addons/delivery/wizard/delivery_sale_order.py +++ b/addons/delivery/wizard/delivery_sale_order.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # @@ -44,11 +44,11 @@ def _delivery_default(self, cr, uid, data, context): </form> """ % (data['id'],) - + if not order.state in ('draft'): raise wizard.except_wizard(_('Order not in draft state !'), _('The order state have to be draft to add delivery lines.')) - + carrier_id = order.partner_id.property_delivery_carrier.id return {'carrier_id': carrier_id} @@ -65,15 +65,15 @@ def _delivery_set(self, cr, uid, data, context): grid = grid_obj.browse(cr, uid, [grid_id])[0] taxes = grid.carrier_id.product_id.taxes_id - taxes_ids = pooler.get_pool(cr.dbname).get('account.fiscal.position').map_tax(cr, uid, order.partner_id, taxes) - + fpos = order.fiscal_position or False + taxes_ids = pooler.get_pool(cr.dbname).get('account.fiscal.position').map_tax(cr, uid, fpos, taxes) line_obj.create(cr, uid, { 'order_id': order.id, 'name': grid.carrier_id.name, 'product_uom_qty': 1, 'product_uom': grid.carrier_id.product_id.uom_id.id, 'product_id': grid.carrier_id.product_id.id, - 'price_unit': grid_obj.get_price(cr, uid, grid.id, order, time.strftime('%Y-%m-%d'), context), + 'price_unit': grid_obj.get_price(cr, uid, grid.id, order, time.strftime('%Y-%m-%d'), context), 'tax_id': [(6,0,taxes_ids)], 'type': 'make_to_stock' }) |
