Bugfix: Odoo Issue #21213
							parent
							
								
									6390d451f2
								
							
						
					
					
						commit
						bcd14fa6fb
					
				|  | @ -914,10 +914,8 @@ class WizardMultiChartsAccounts(models.TransientModel): | ||||||
|         IrConfig = self.env['ir.config_parameter'] |         IrConfig = self.env['ir.config_parameter'] | ||||||
|         if self.sale_tax_id and taxes_ref: |         if self.sale_tax_id and taxes_ref: | ||||||
|             IrDefault.sudo().set('product.template', "taxes_id", [taxes_ref[self.sale_tax_id.id]], company_id=company.id) |             IrDefault.sudo().set('product.template', "taxes_id", [taxes_ref[self.sale_tax_id.id]], company_id=company.id) | ||||||
|             IrConfig.sudo().set_param("account.default_sale_tax_id", taxes_ref[self.sale_tax_id.id]) |  | ||||||
|         if self.purchase_tax_id and taxes_ref: |         if self.purchase_tax_id and taxes_ref: | ||||||
|             IrDefault.sudo().set('product.template', "supplier_taxes_id", [taxes_ref[self.purchase_tax_id.id]], company_id=company.id) |             IrDefault.sudo().set('product.template', "supplier_taxes_id", [taxes_ref[self.purchase_tax_id.id]], company_id=company.id) | ||||||
|             IrConfig.sudo().set_param("account.default_purchase_tax_id", taxes_ref[self.purchase_tax_id.id]) |  | ||||||
| 
 | 
 | ||||||
|         # Create Bank journals |         # Create Bank journals | ||||||
|         self._create_bank_journals_from_o2m(company, acc_template_ref) |         self._create_bank_journals_from_o2m(company, acc_template_ref) | ||||||
|  |  | ||||||
|  | @ -64,17 +64,18 @@ class ResConfigSettings(models.TransientModel): | ||||||
|     def get_values(self): |     def get_values(self): | ||||||
|         res = super(ResConfigSettings, self).get_values() |         res = super(ResConfigSettings, self).get_values() | ||||||
|         params = self.env['ir.config_parameter'].sudo() |         params = self.env['ir.config_parameter'].sudo() | ||||||
|  | 
 | ||||||
|  |         supplier_tax_ids = self.env['ir.default'].get('product.template', "supplier_taxes_id", company_id=True) | ||||||
|  |         sale_tax_ids = self.env['ir.default'].get('product.template', "taxes_id", company_id=True) | ||||||
|         res.update( |         res.update( | ||||||
|             default_purchase_tax_id=int(params.get_param('account.default_purchase_tax_id', default=False)) or False, |             default_purchase_tax_id=supplier_tax_ids and supplier_tax_ids[0] or False, | ||||||
|             default_sale_tax_id=int(params.get_param('account.default_sale_tax_id', default=False)) or False |             default_sale_tax_id=sale_tax_ids and sale_tax_ids[0] or False, | ||||||
|         ) |         ) | ||||||
|         return res |         return res | ||||||
| 
 | 
 | ||||||
|     @api.multi |     @api.multi | ||||||
|     def set_values(self): |     def set_values(self): | ||||||
|         super(ResConfigSettings, self).set_values() |         super(ResConfigSettings, self).set_values() | ||||||
|         self.env['ir.config_parameter'].sudo().set_param("account.default_purchase_tax_id", self.default_purchase_tax_id.id) |  | ||||||
|         self.env['ir.config_parameter'].sudo().set_param("account.default_sale_tax_id", self.default_sale_tax_id.id) |  | ||||||
|         if self.group_multi_currency: |         if self.group_multi_currency: | ||||||
|             self.env.ref('base.group_user').write({'implied_ids': [(4, self.env.ref('product.group_sale_pricelist').id)]}) |             self.env.ref('base.group_user').write({'implied_ids': [(4, self.env.ref('product.group_sale_pricelist').id)]}) | ||||||
|         """ Set the product taxes if they have changed """ |         """ Set the product taxes if they have changed """ | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue