Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Accounting Periods
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XCG
Odoo modules
Accounting Periods
Commits
f546cb8fbfeb
Commit
f546cb8fbfeb
authored
6 years ago
by
Houzefa Abbasbhay
Browse files
Options
Downloads
Patches
Plain Diff
Tweak field declarations
parent
562791d9095c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
models/account_fiscalyear.py
+10
-2
10 additions, 2 deletions
models/account_fiscalyear.py
models/account_period.py
+26
-8
26 additions, 8 deletions
models/account_period.py
views/account_period.xml
+9
-9
9 additions, 9 deletions
views/account_period.xml
with
45 additions
and
19 deletions
models/account_fiscalyear.py
+
10
−
2
View file @
f546cb8f
...
@@ -31,7 +31,9 @@
...
@@ -31,7 +31,9 @@
code
=
fields
.
Char
(
code
=
fields
.
Char
(
string
=
'
Code
'
,
string
=
'
Code
'
,
size
=
6
,
help
=
'
Unique code of this fiscal year.
'
,
index
=
True
,
required
=
True
,
)
)
name
=
fields
.
Char
(
name
=
fields
.
Char
(
...
@@ -35,7 +37,8 @@
...
@@ -35,7 +37,8 @@
)
)
name
=
fields
.
Char
(
name
=
fields
.
Char
(
string
=
'
Fiscal year
'
,
string
=
'
Name
'
,
help
=
'
Displayed name of this fiscal year.
'
,
required
=
True
,
required
=
True
,
)
)
...
@@ -43,4 +46,5 @@
...
@@ -43,4 +46,5 @@
comodel_name
=
'
account.period
'
,
comodel_name
=
'
account.period
'
,
inverse_name
=
'
fiscalyear_id
'
,
inverse_name
=
'
fiscalyear_id
'
,
string
=
'
Periods
'
,
string
=
'
Periods
'
,
help
=
'
The periods inside this fiscal year.
'
,
)
)
...
@@ -46,1 +50,5 @@
...
@@ -46,1 +50,5 @@
)
)
_sql_constraints
=
[
(
'
unique_code
'
,
'
UNIQUE(code)
'
,
'
The code must be unique.
'
),
]
This diff is collapsed.
Click to expand it.
models/account_period.py
+
26
−
8
View file @
f546cb8f
...
@@ -34,7 +34,17 @@
...
@@ -34,7 +34,17 @@
code
=
fields
.
Char
(
code
=
fields
.
Char
(
string
=
'
Code
'
,
string
=
'
Code
'
,
size
=
12
,
help
=
'
Unique code of this period.
'
,
index
=
True
,
required
=
True
,
)
date_cutoff
=
fields
.
Date
(
string
=
'
Cut-off date
'
,
help
=
(
'
Optional cut-off date which helps force transaction dates and
'
'
this period for a few days after the end of this period.
'
),
)
)
date_start
=
fields
.
Date
(
date_start
=
fields
.
Date
(
...
@@ -38,8 +48,9 @@
...
@@ -38,8 +48,9 @@
)
)
date_start
=
fields
.
Date
(
date_start
=
fields
.
Date
(
string
=
'
Start of period
'
,
string
=
'
Start
'
,
help
=
'
When this period starts.
'
,
required
=
True
,
required
=
True
,
)
)
date_stop
=
fields
.
Date
(
date_stop
=
fields
.
Date
(
...
@@ -42,11 +53,12 @@
...
@@ -42,11 +53,12 @@
required
=
True
,
required
=
True
,
)
)
date_stop
=
fields
.
Date
(
date_stop
=
fields
.
Date
(
string
=
'
End of period
'
,
string
=
'
End
'
,
help
=
'
When this period ends.
'
,
required
=
True
,
required
=
True
,
)
)
fiscalyear_id
=
fields
.
Many2one
(
fiscalyear_id
=
fields
.
Many2one
(
comodel_name
=
'
account.fiscalyear
'
,
comodel_name
=
'
account.fiscalyear
'
,
string
=
'
Fiscal year
'
,
string
=
'
Fiscal year
'
,
...
@@ -47,14 +59,12 @@
...
@@ -47,14 +59,12 @@
required
=
True
,
required
=
True
,
)
)
fiscalyear_id
=
fields
.
Many2one
(
fiscalyear_id
=
fields
.
Many2one
(
comodel_name
=
'
account.fiscalyear
'
,
comodel_name
=
'
account.fiscalyear
'
,
string
=
'
Fiscal year
'
,
string
=
'
Fiscal year
'
,
)
help
=
'
The fiscal year this period is in.
'
,
ondelete
=
'
cascade
'
,
input_date_stop
=
fields
.
Date
(
string
=
'
End of input
'
,
required
=
True
,
required
=
True
,
)
)
name
=
fields
.
Char
(
name
=
fields
.
Char
(
...
@@ -57,8 +67,9 @@
...
@@ -57,8 +67,9 @@
required
=
True
,
required
=
True
,
)
)
name
=
fields
.
Char
(
name
=
fields
.
Char
(
string
=
'
Period name
'
,
string
=
'
Name
'
,
help
=
'
Displayed name of this period.
'
,
required
=
True
,
required
=
True
,
)
)
...
@@ -68,4 +79,7 @@
...
@@ -68,4 +79,7 @@
(
'
done
'
,
'
Closed
'
),
(
'
done
'
,
'
Closed
'
),
],
],
string
=
'
State
'
,
string
=
'
State
'
,
default
=
'
draft
'
,
readonly
=
True
,
required
=
True
,
)
)
...
@@ -71,1 +85,5 @@
...
@@ -71,1 +85,5 @@
)
)
_sql_constraints
=
[
(
'
unique_code
'
,
'
UNIQUE(code)
'
,
'
The code must be unique.
'
),
]
This diff is collapsed.
Click to expand it.
views/account_period.xml
+
9
−
9
View file @
f546cb8f
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<tree>
<tree>
<field
name=
"fiscalyear_id"
/>
<field
name=
"fiscalyear_id"
/>
<field
name=
"name"
/>
<field
name=
"name"
/>
<field
name=
"code"
/>
<field
name=
"code"
/>
<field
name=
"date_start"
/>
<field
name=
"date_start"
/>
<field
name=
"date_stop"
/>
<field
name=
"date_stop"
/>
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
<field
name=
"code"
/>
<field
name=
"code"
/>
<field
name=
"date_start"
/>
<field
name=
"date_start"
/>
<field
name=
"date_stop"
/>
<field
name=
"date_stop"
/>
<field
name=
"
input_date_stop
"
/>
<field
name=
"
date_cutoff
"
/>
<field
name=
"state"
/>
<field
name=
"state"
/>
</tree>
</tree>
...
@@ -43,12 +43,12 @@
...
@@ -43,12 +43,12 @@
<sheet>
<sheet>
<group
col=
"4"
>
<group
col=
"4"
>
<field
name=
"name"
/>
<field
name=
"name"
/>
<field
name=
"
date_start
"
/>
<field
name=
"
code
"
/>
<field
name=
"
fiscalyear_id
"
/>
<field
name=
"
date_start
"
/>
<field
name=
"
date_stop
"
/>
<field
name=
"
fiscalyear_id
"
/>
<field
name=
"
code
"
/>
<field
name=
"
date_stop
"
/>
<field
name=
"
input_date_stop
"
/>
<field
name=
"
date_cutoff
"
/>
</group>
</group>
</sheet>
</sheet>
</form>
</form>
...
@@ -66,6 +66,6 @@
...
@@ -66,6 +66,6 @@
</record>
</record>
<menuitem
id=
"account_period_menu_command"
parent=
"account.account_account_menu"
<menuitem
id=
"account_period_menu_command"
parent=
"account.account_account_menu"
name=
"Accounting periods"
action=
"account_period_action"
/>
name=
"Accounting periods"
action=
"account_period_action"
/>
</odoo>
</odoo>
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