Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Tryton
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tryton
Tryton
Commits
58c224a2
Commit
58c224a2
authored
11 years ago
by
Cédric Krier
Browse files
Options
Downloads
Patches
Plain Diff
New tax rates for 2014
issue3596 review3341002
parent
4f886bc5
No related branches found
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG
+2
-0
2 additions, 0 deletions
CHANGELOG
__init__.py
+10
-0
10 additions, 0 deletions
__init__.py
account.py
+70
-0
70 additions, 0 deletions
account.py
tax_fr.xml
+348
-54
348 additions, 54 deletions
tax_fr.xml
with
430 additions
and
54 deletions
CHANGELOG
+
2
−
0
View file @
58c224a2
* New tax rates for 2014
Version 3.0.0 - 2013-10-21
* Bug fixes (see mercurial logs for details)
...
...
This diff is collapsed.
Click to expand it.
__init__.py
+
10
−
0
View file @
58c224a2
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from
trytond.pool
import
Pool
from
account
import
*
def
register
():
Pool
.
register
(
TaxTemplate
,
TaxRuleTemplate
,
module
=
'
account_fr
'
,
type_
=
'
model
'
)
This diff is collapsed.
Click to expand it.
account.py
0 → 100644
+
70
−
0
View file @
58c224a2
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from
sql
import
Table
from
trytond.pool
import
PoolMeta
from
trytond.transaction
import
Transaction
__all__
=
[
'
TaxTemplate
'
,
'
TaxRuleTemplate
'
]
__metaclass__
=
PoolMeta
class
TaxTemplate
:
__name__
=
'
account.tax.template
'
@classmethod
def
__register__
(
cls
,
module_name
):
cursor
=
Transaction
().
cursor
model_data
=
Table
(
'
ir_model_data
'
)
# Migration from 3.0: new tax rates
if
module_name
==
'
account_fr
'
:
for
old_id
,
new_id
in
(
(
'
tva_vente_19_6
'
,
'
tva_vente_taux_normal
'
),
(
'
tva_vente_7
'
,
'
tva_vente_taux_intermediaire
'
),
(
'
tva_vente_intracommunautaire_19_6
'
,
'
tva_vente_intracommunautaire_taux_normal
'
),
(
'
tva_vente_intracommunautaire_7
'
,
'
tva_vente_intracommunautaire_taux_intermediaire
'
),
(
'
tva_achat_19_6
'
,
'
tva_achat_taux_normal
'
),
(
'
tva_achat_7
'
,
'
tva_achat_taux_intermediaire
'
),
(
'
tva_achat_intracommunautaire_19_6
'
,
'
tva_achat_intracommunautaire_taux_normal
'
),
):
cursor
.
execute
(
*
model_data
.
select
(
model_data
.
id
,
where
=
(
model_data
.
fs_id
==
new_id
)
&
(
model_data
.
module
==
module_name
)))
if
cursor
.
fetchone
():
continue
cursor
.
execute
(
*
model_data
.
update
(
columns
=
[
model_data
.
fs_id
],
values
=
[
new_id
],
where
=
(
model_data
.
fs_id
==
old_id
)
&
(
model_data
.
module
==
module_name
)))
super
(
TaxTemplate
,
cls
).
__register__
(
module_name
)
class
TaxRuleTemplate
:
__name__
=
'
account.tax.rule.template
'
@classmethod
def
__register__
(
cls
,
module_name
):
cursor
=
Transaction
().
cursor
model_data
=
Table
(
'
ir_model_data
'
)
if
module_name
==
'
account_fr
'
:
for
old_id
,
new_id
in
(
(
'
tax_rule_ventes_intracommunautaires_19_6
'
,
'
tax_rule_ventes_intracommunautaires_taux_normal
'
),
(
'
tax_rule_ventes_intracommunautaires_7
'
,
'
tax_rule_ventes_intracommunautaires_taux_intermediaire
'
),
):
cursor
.
execute
(
*
model_data
.
update
(
columns
=
[
model_data
.
fs_id
],
values
=
[
new_id
],
where
=
(
model_data
.
fs_id
==
old_id
)
&
(
model_data
.
module
==
module_name
)))
super
(
TaxRuleTemplate
,
cls
).
__register__
(
module_name
)
This diff is collapsed.
Click to expand it.
tax_fr.xml
+
348
−
54
View file @
58c224a2
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment