Skip to content
Snippets Groups Projects
Commit f546cb8fbfeb authored by Houzefa Abbasbhay's avatar Houzefa Abbasbhay :slight_smile:
Browse files

Tweak field declarations

parent 562791d9095c
No related branches found
No related tags found
No related merge requests found
...@@ -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.'),
]
...@@ -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.'),
]
...@@ -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>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment