-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] account_ux: improve three cases on setting default taxes
1. al instalar el plan de cuentas, no se estaba seteando este valor por defecto de res.config, esto solo afectaba si el usuario hacia un cambio 2. si se cambiaba plan de cuentas, como se hace desde un res.config.settings y el inverse se llamaba antes de cambiar el plan, entonces quedaban seteados valores por defecto erroneos 3. mejoramos para que a los productos existentes se les asigne el impuesto por defecto (salvo que ya tengan algún otro de esta compañía)
- Loading branch information
1 parent
72d951c
commit 0fb210e
Showing
3 changed files
with
43 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from odoo import models | ||
|
||
|
||
class AccountChartTemplate(models.Model): | ||
_inherit = "account.chart.template" | ||
|
||
def _load(self, company): | ||
res = super()._load(company) | ||
self.env['res.config.settings']._set_default_tax('sale', company.account_sale_tax_id, company) | ||
self.env['res.config.settings']._set_default_tax('purchase', company.account_purchase_tax_id, company) | ||
return res |
This file contains 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