[FIX] sale: fiscal position wrongly taken based on country group.
An automatic fiscal position with a country group can only match with a sale order from a customer who has a country defined. opw:627087
This commit is contained in:
parent
8be29c33fa
commit
d5a50fd346
|
@ -127,14 +127,14 @@ class account_fiscal_position(osv.osv):
|
||||||
('auto_apply', '=', True),
|
('auto_apply', '=', True),
|
||||||
'|', ('vat_required', '=', False), ('vat_required', '=', partner.vat_subjected),
|
'|', ('vat_required', '=', False), ('vat_required', '=', partner.vat_subjected),
|
||||||
]
|
]
|
||||||
|
if delivery.country_id.id:
|
||||||
|
fiscal_position_ids = self.search(cr, uid, domain + [('country_id', '=', delivery.country_id.id)], context=context, limit=1)
|
||||||
|
if fiscal_position_ids:
|
||||||
|
return fiscal_position_ids[0]
|
||||||
|
|
||||||
fiscal_position_ids = self.search(cr, uid, domain + [('country_id', '=', delivery.country_id.id)], context=context, limit=1)
|
fiscal_position_ids = self.search(cr, uid, domain + [('country_group_id.country_ids', '=', delivery.country_id.id)], context=context, limit=1)
|
||||||
if fiscal_position_ids:
|
if fiscal_position_ids:
|
||||||
return fiscal_position_ids[0]
|
return fiscal_position_ids[0]
|
||||||
|
|
||||||
fiscal_position_ids = self.search(cr, uid, domain + [('country_group_id.country_ids', '=', delivery.country_id.id)], context=context, limit=1)
|
|
||||||
if fiscal_position_ids:
|
|
||||||
return fiscal_position_ids[0]
|
|
||||||
|
|
||||||
fiscal_position_ids = self.search(cr, uid, domain + [('country_id', '=', None), ('country_group_id', '=', None)], context=context, limit=1)
|
fiscal_position_ids = self.search(cr, uid, domain + [('country_id', '=', None), ('country_group_id', '=', None)], context=context, limit=1)
|
||||||
if fiscal_position_ids:
|
if fiscal_position_ids:
|
||||||
|
|
Loading…
Reference in New Issue