bzr revid: fp@tinyerp.com-20081021150056-t7lg8vzfaz5dnc6u
This commit is contained in:
Fabien Pinckaers 2008-10-21 17:00:56 +02:00
parent bc33c13e56
commit b05f060b8a
2 changed files with 2 additions and 18 deletions

View File

@ -42,8 +42,6 @@
<tree string="Fiscal Position">
<field name="name"/>
<field name="company_id"/>
<field name="account_tax"/>
<field name="account_supplier_tax"/>
</tree>
</field>
</record>

View File

@ -1000,25 +1000,11 @@ class mrp_procurement(osv.osv):
'notes':product.description_purchase,
}
taxes = self.pool.get('account.tax').browse(cr, uid,
[x.id for x in procurement.product_id.product_tmpl_id.supplier_taxes_id])
taxep = None
if partner_id:
taxep = partner.property_account_position and partner.property_account_position.account_supplier_tax
if not taxep or not taxep.id:
taxes_ids = [x.id for x in procurement.product_id.product_tmpl_id.supplier_taxes_id]
else:
res5 = [taxep.id]
for t in taxes:
if not t.tax_group==taxep.tax_group:
res5.append(t.id)
taxes_ids = res5
taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id
self.pool.get('account.fiscal.position').map_tax(cr, uid, partner, taxes)
line.update({
'taxes_id':[(6,0,taxes_ids)]
})
purchase_id = self.pool.get('purchase.order').create(cr, uid, {
'origin': procurement.origin,
'partner_id': partner_id,