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
query = "update res_partner set commercial_partner_id =" + str(object.x_commercial_partner_id.id) + " where id = " + str(object.id) + ";" | |
env.cr.execute(query) | |
# Execute Python Code Action based on an Automated Action listening for UPDATES to res.partner | |
# Add x_commercial_partner_id with appropriate group restricted view |
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
delete from crm_lead; | |
delete from purchase_order_line; | |
delete from purchase_order; | |
delete from sale_order_line; | |
delete from sale_order; | |
delete from procurement_order; | |
delete from procurement_group; |
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 |