summaryrefslogtreecommitdiff
path: root/addons/account/models/company.py
diff options
context:
space:
mode:
authorVictor Feyens <vfe@odoo.com>2020-02-06 11:18:22 +0000
committerVictor Feyens <vfe@odoo.com>2020-05-07 13:11:50 +0000
commit5c0b431baf1e1c30033e63b6aca2d75bcd8b6b70 (patch)
tree0978c04749b7dc31a46e5e2e7271bc29b1b3aa96 /addons/account/models/company.py
parent3a8166d74af7b9d9e011344623a7b5d930422246 (diff)
[IMP] account: factorize company onboarding steps
Diffstat (limited to 'addons/account/models/company.py')
-rw-r--r--addons/account/models/company.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/addons/account/models/company.py b/addons/account/models/company.py
index 40128bb2f4a..a04ccd3243b 100644
--- a/addons/account/models/company.py
+++ b/addons/account/models/company.py
@@ -27,6 +27,13 @@ MONTH_SELECTION = [
('12', 'December'),
]
+ONBOARDING_STEP_STATES = [
+ ('not_done', "Not done"),
+ ('just_done', "Just done"),
+ ('done', "Done"),
+]
+DASHBOARD_ONBOARDING_STATES = ONBOARDING_STEP_STATES + [('closed', 'Closed')]
+
class ResCompany(models.Model):
_inherit = "res.company"
@@ -80,17 +87,16 @@ class ResCompany(models.Model):
account_opening_date = fields.Date(string='Opening Entry', default=lambda self: fields.Date.today().replace(month=1, day=1), required=True, help="That is the date of the opening entry.")
# Fields marking the completion of a setup step
- # YTI FIXME : The selection should be factorize as a static list in base, like ONBOARDING_STEP_STATES
- account_setup_bank_data_state = fields.Selection([('not_done', "Not done"), ('just_done', "Just done"), ('done', "Done")], string="State of the onboarding bank data step", default='not_done')
- account_setup_fy_data_state = fields.Selection([('not_done', "Not done"), ('just_done', "Just done"), ('done', "Done")], string="State of the onboarding fiscal year step", default='not_done')
- account_setup_coa_state = fields.Selection([('not_done', "Not done"), ('just_done', "Just done"), ('done', "Done")], string="State of the onboarding charts of account step", default='not_done')
- account_onboarding_invoice_layout_state = fields.Selection([('not_done', "Not done"), ('just_done', "Just done"), ('done', "Done")], string="State of the onboarding invoice layout step", default='not_done')
- account_onboarding_sample_invoice_state = fields.Selection([('not_done', "Not done"), ('just_done', "Just done"), ('done', "Done")], string="State of the onboarding sample invoice step", default='not_done')
- account_onboarding_sale_tax_state = fields.Selection([('not_done', "Not done"), ('just_done', "Just done"), ('done', "Done")], string="State of the onboarding sale tax step", default='not_done')
+ account_setup_bank_data_state = fields.Selection(ONBOARDING_STEP_STATES, string="State of the onboarding bank data step", default='not_done')
+ account_setup_fy_data_state = fields.Selection(ONBOARDING_STEP_STATES, string="State of the onboarding fiscal year step", default='not_done')
+ account_setup_coa_state = fields.Selection(ONBOARDING_STEP_STATES, string="State of the onboarding charts of account step", default='not_done')
+ account_onboarding_invoice_layout_state = fields.Selection(ONBOARDING_STEP_STATES, string="State of the onboarding invoice layout step", default='not_done')
+ account_onboarding_sample_invoice_state = fields.Selection(ONBOARDING_STEP_STATES, string="State of the onboarding sample invoice step", default='not_done')
+ account_onboarding_sale_tax_state = fields.Selection(ONBOARDING_STEP_STATES, string="State of the onboarding sale tax step", default='not_done')
# account dashboard onboarding
- account_invoice_onboarding_state = fields.Selection([('not_done', "Not done"), ('just_done', "Just done"), ('done', "Done"), ('closed', "Closed")], string="State of the account invoice onboarding panel", default='not_done')
- account_dashboard_onboarding_state = fields.Selection([('not_done', "Not done"), ('just_done', "Just done"), ('done', "Done"), ('closed', "Closed")], string="State of the account dashboard onboarding panel", default='not_done')
+ account_invoice_onboarding_state = fields.Selection(DASHBOARD_ONBOARDING_STATES, string="State of the account invoice onboarding panel", default='not_done')
+ account_dashboard_onboarding_state = fields.Selection(DASHBOARD_ONBOARDING_STATES, string="State of the account dashboard onboarding panel", default='not_done')
invoice_terms = fields.Text(string='Default Terms and Conditions', translate=True)
# Needed in the Point of Sale