Last active
August 25, 2017 17:20
-
-
Save vcloud9ray/8bb47341c7c858292b223dfa3fd6a080 to your computer and use it in GitHub Desktop.
Odoo. ORM. res.partner. Set fiscal position to Tax Exempt when Country is not United States
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@api.onchange('country_id') | |
def _onchange_country(self): | |
usa_country_id = self.env['res.country'].search([('name','=','United States')]).id | |
tax_exempt_fiscal_position = self.env['account.fiscal.position'].search([('name', '=', 'Tax Exempt')]) | |
for record in self: | |
if record.country_id.id != usa_country_id : | |
record.property_account_position_id = tax_exempt_fiscal_position |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment