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
91477981
Commit
91477981
authored
3 years ago
by
Cédric Krier
Browse files
Options
Downloads
Patches
Plain Diff
Add monetary field
issue10598 review338511002
parent
a6b4d67f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!114
Return an empty list when the treeview has no selection
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
reporting_tax.py
+23
-33
23 additions, 33 deletions
reporting_tax.py
tryton.cfg
+1
-0
1 addition, 0 deletions
tryton.cfg
view/es_ec_operation_list.xml
+0
-1
0 additions, 1 deletion
view/es_ec_operation_list.xml
view/vat_list_list.xml
+0
-1
0 additions, 1 deletion
view/vat_list_list.xml
with
24 additions
and
35 deletions
reporting_tax.py
+
23
−
33
View file @
91477981
...
...
@@ -25,6 +25,7 @@
from
trytond.wizard
import
Wizard
,
StateView
,
StateTransition
,
StateReport
,
\
Button
from
trytond.modules.account_eu.account
import
ECSalesList
,
ECSalesListContext
from
trytond.modules.currency.fields
import
Monetary
from
.exceptions
import
PrintError
...
...
@@ -380,19 +381,13 @@
province_code
=
fields
.
Function
(
fields
.
Char
(
"
Province Code
"
),
'
get_province_code
'
,
searcher
=
'
search_province_code
'
)
code
=
fields
.
Char
(
"
Code
"
)
amount
=
fields
.
Numeric
(
"
Amount
"
,
digits
=
(
16
,
Eval
(
'
currency_digits
'
,
2
)),
depends
=
[
'
currency_digits
'
])
first_period_amount
=
fields
.
Numeric
(
"
First Period Amount
"
,
digits
=
(
16
,
Eval
(
'
currency_digits
'
,
2
)),
depends
=
[
'
currency_digits
'
])
second_period_amount
=
fields
.
Numeric
(
"
Second Period Amount
"
,
digits
=
(
16
,
Eval
(
'
currency_digits
'
,
2
)),
depends
=
[
'
currency_digits
'
])
third_period_amount
=
fields
.
Numeric
(
"
Third Period Amount
"
,
digits
=
(
16
,
Eval
(
'
currency_digits
'
,
2
)),
depends
=
[
'
currency_digits
'
])
fourth_period_amount
=
fields
.
Numeric
(
"
Fourth Period Amount
"
,
digits
=
(
16
,
Eval
(
'
currency_digits
'
,
2
)),
depends
=
[
'
currency_digits
'
])
amount
=
Monetary
(
"
Amount
"
,
currency
=
'
currency
'
,
digits
=
'
currency
'
)
first_period_amount
=
Monetary
(
"
First Period Amount
"
,
currency
=
'
currency
'
,
digits
=
'
currency
'
)
second_period_amount
=
Monetary
(
"
Second Period Amount
"
,
currency
=
'
currency
'
,
digits
=
'
currency
'
)
third_period_amount
=
Monetary
(
"
Third Period Amount
"
,
currency
=
'
currency
'
,
digits
=
'
currency
'
)
fourth_period_amount
=
Monetary
(
"
Fourth Period Amount
"
,
currency
=
'
currency
'
,
digits
=
'
currency
'
)
currency
=
fields
.
Many2One
(
'
currency.currency
'
,
"
Currency
"
)
...
...
@@ -398,9 +393,4 @@
currency
=
fields
.
Many2One
(
'
currency.currency
'
,
"
Currency
"
)
currency_digits
=
fields
.
Function
(
fields
.
Integer
(
"
Currency Digits
"
),
'
get_currency_digits
'
)
def
get_currency_digits
(
self
,
name
):
return
self
.
currency
.
digits
@classmethod
def
get_province_code
(
cls
,
records
,
name
):
...
...
@@ -771,10 +761,8 @@
party_tax_identifier
=
fields
.
Many2One
(
'
party.identifier
'
,
"
Party Tax Identifier
"
)
tax
=
fields
.
Many2One
(
'
account.tax
'
,
"
Tax
"
)
base_amount
=
fields
.
Numeric
(
"
Base Amount
"
,
digits
=
(
16
,
Eval
(
'
currency_digits
'
,
2
)),
depends
=
[
'
currency_digits
'
])
tax_amount
=
fields
.
Numeric
(
"
Tax Amount
"
,
digits
=
(
16
,
Eval
(
'
currency_digits
'
,
2
)),
depends
=
[
'
currency_digits
'
])
base_amount
=
Monetary
(
"
Base Amount
"
,
currency
=
'
currency
'
,
digits
=
'
currency
'
)
tax_amount
=
Monetary
(
"
Tax Amount
"
,
currency
=
'
currency
'
,
digits
=
'
currency
'
)
surcharge_tax
=
fields
.
Many2One
(
'
account.tax
'
,
"
Surcharge Tax
"
)
...
...
@@ -780,6 +768,6 @@
surcharge_tax
=
fields
.
Many2One
(
'
account.tax
'
,
"
Surcharge Tax
"
)
surcharge_tax_amount
=
fields
.
Numeric
(
"
Surcharge Tax Amount
"
,
digits
=
(
16
,
Eval
(
'
currency
_
digits
'
,
2
))
,
surcharge_tax_amount
=
Monetary
(
"
Surcharge Tax Amount
"
,
currency
=
'
currency
'
,
digits
=
'
currency
'
,
states
=
{
'
invisible
'
:
~
(
Eval
(
'
surcharge_tax
'
,
None
)),
},
...
...
@@ -783,9 +771,11 @@
states
=
{
'
invisible
'
:
~
(
Eval
(
'
surcharge_tax
'
,
None
)),
},
depends
=
[
'
currency_digits
'
,
'
surcharge_tax
'
])
currency_digits
=
fields
.
Function
(
fields
.
Integer
(
"
Currency Digits
"
),
'
get_currency_digits
'
)
depends
=
[
'
surcharge_tax
'
])
currency
=
fields
.
Function
(
fields
.
Many2One
(
'
currency.currency
'
,
"
Currency
"
),
'
get_currency
'
)
@classmethod
def
included_tax_groups
(
cls
):
...
...
@@ -891,8 +881,8 @@
]))
return
query
def
get_currency
_digits
(
self
,
name
):
return
self
.
invoice
.
company
.
currency
.
d
igits
def
get_currency
(
self
,
name
):
return
self
.
invoice
.
company
.
currency
.
i
d
class
VATBookReport
(
Report
):
...
...
This diff is collapsed.
Click to expand it.
tryton.cfg
+
1
−
0
View file @
91477981
[tryton]
version
=
6.1.0
depends:
currency
ir
account
account_eu
...
...
This diff is collapsed.
Click to expand it.
view/es_ec_operation_list.xml
+
0
−
1
View file @
91477981
...
...
@@ -7,5 +7,4 @@
<field
name=
"party_tax_identifier"
expand=
"1"
/>
<field
name=
"code"
/>
<field
name=
"amount"
/>
<field
name=
"currency"
/>
</tree>
This diff is collapsed.
Click to expand it.
view/vat_list_list.xml
+
0
−
1
View file @
91477981
...
...
@@ -12,5 +12,4 @@
<field
name=
"second_period_amount"
/>
<field
name=
"third_period_amount"
/>
<field
name=
"fourth_period_amount"
/>
<field
name=
"currency"
/>
</tree>
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