Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
234 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
from . import company | ||
from . import account | ||
from . import account_cutoff | ||
from . import res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Copyright 2018 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = 'res.config.settings' | ||
|
||
default_accrued_revenue_account_id = fields.Many2one( | ||
comodel_name='account.account', | ||
string='Default Account for Accrued Revenues', | ||
domain=[('deprecated', '=', False)], | ||
) | ||
|
||
default_accrued_expense_account_id = fields.Many2one( | ||
comodel_name='account.account', | ||
string='Default Account for Accrued Expenses', | ||
domain=[('deprecated', '=', False)], | ||
) | ||
|
||
default_accrual_revenue_journal_id = fields.Many2one( | ||
comodel_name='account.journal', | ||
string='Default Journal for Accrued Revenues' | ||
) | ||
|
||
default_accrual_expense_journal_id = fields.Many2one( | ||
comodel_name='account.journal', | ||
string='Default Journal for Accrued Expenses' | ||
) | ||
|
||
config_fields = [ | ||
'default_accrued_revenue_account_id', | ||
'default_accrued_expense_account_id', | ||
'default_accrual_revenue_journal_id', | ||
'default_accrual_expense_journal_id', | ||
] | ||
|
||
@api.multi | ||
def get_values(self): | ||
res = super(ResConfigSettings, self).get_values() | ||
company = self.env.user.company_id | ||
values = dict( | ||
[(field, company[field].id) for field in self.config_fields] | ||
) | ||
res.update(values) | ||
return res | ||
|
||
@api.multi | ||
def set_values(self): | ||
super(ResConfigSettings, self).set_values() | ||
company = self.env.user.company_id | ||
|
||
values = dict( | ||
[(field, self[field]) for field in self.config_fields] | ||
) | ||
company.update(values) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data> | ||
|
||
<record id="res_config_settings_view_form" model="ir.ui.view"> | ||
<field name="name">res.config.settings.view.form.inherit.account</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="priority" eval="50"/> | ||
<field name="inherit_id" ref="account_cutoff_base.res_config_settings_view_form"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@name='account_closing_cutoffs']" position="inside"> | ||
|
||
<div class="col-xs-12 col-md-12 o_setting_box"> | ||
<div class="o_setting_left_pane"> | ||
</div> | ||
<div class="o_setting_right_pane"> | ||
<label string="Accruals"/> | ||
<div class="content-group"> | ||
<div class="row mt16"> | ||
|
||
<label string="Account for Accrued Expense" class="col-md-3 o_light_label"/> | ||
<field name="default_accrued_expense_account_id" /> | ||
<label string="Account for Accrued Revenue" class="col-md-3 o_light_label"/> | ||
<field name="default_accrued_revenue_account_id" /> | ||
<label string="Journal for Accrued Expenses" class="col-md-3 o_light_label"/> | ||
<field name="default_accrual_expense_journal_id" /> | ||
<label string="Journal for Accrued Revenues" class="col-md-3 o_light_label"/> | ||
<field name="default_accrual_revenue_journal_id" /> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</data> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from . import account_cutoff | ||
from . import company | ||
from . import res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2018 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = 'res.config.settings' | ||
|
||
default_cutoff_journal_id = fields.Many2one( | ||
'account.journal', | ||
string='Default Cut-off Journal' | ||
) | ||
|
||
@api.multi | ||
def get_values(self): | ||
res = super(ResConfigSettings, self).get_values() | ||
company = self.env.user.company_id | ||
res.update({ | ||
'default_cutoff_journal_id':company.default_cutoff_journal_id.id | ||
}) | ||
return res | ||
|
||
@api.multi | ||
def set_values(self): | ||
super(ResConfigSettings, self).set_values() | ||
company = self.env.user.company_id | ||
company.default_cutoff_journal_id = self.default_cutoff_journal_id |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data> | ||
|
||
<record id="res_config_settings_view_form" model="ir.ui.view"> | ||
<field name="name">res.config.settings.view.form.inherit.account</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="priority" eval="50"/> | ||
<field name="inherit_id" ref="account.res_config_settings_view_form"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@id='accounting_reports']" position="after"> | ||
|
||
<h2>Account Closing Cut-offs</h2> | ||
<div name="account_closing_cutoffs" class="row mt16 o_settings_container" title=""> | ||
<div class="col-xs-12 col-md-12 o_setting_box"> | ||
<div class="o_setting_left_pane"> | ||
</div> | ||
<div class="o_setting_right_pane"> | ||
<div class="content-group"> | ||
<div class="row mt16"> | ||
<label string="Default Cut-off Journal" class="col-md-3 o_light_label"/> | ||
<field name="default_cutoff_journal_id" /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</data> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from . import company | ||
from . import account_cutoff | ||
from . import res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 2018 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = 'res.config.settings' | ||
|
||
default_prepaid_revenue_account_id = fields.Many2one( | ||
'account.account', | ||
string='Default Account for Prepaid Revenue', | ||
domain=[('deprecated', '=', False)] | ||
) | ||
default_prepaid_expense_account_id = fields.Many2one( | ||
'account.account', | ||
string='Default Account for Prepaid Expense', | ||
domain=[('deprecated', '=', False)] | ||
) | ||
|
||
@api.multi | ||
def get_values(self): | ||
res = super(ResConfigSettings, self).get_values() | ||
company = self.env.user.company_id | ||
res.update({ | ||
'default_prepaid_revenue_account_id':company.default_prepaid_revenue_account_id.id, | ||
'default_prepaid_expense_account_id':company.default_prepaid_expense_account_id.id, | ||
}) | ||
return res | ||
|
||
@api.multi | ||
def set_values(self): | ||
super(ResConfigSettings, self).set_values() | ||
company = self.env.user.company_id | ||
company.default_prepaid_expense_account_id = self.default_prepaid_expense_account_id | ||
company.default_prepaid_revenue_account_id = self.default_prepaid_revenue_account_id |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data> | ||
|
||
<record id="res_config_settings_view_form" model="ir.ui.view"> | ||
<field name="name">res.config.settings.view.form.inherit.account</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="priority" eval="50"/> | ||
<field name="inherit_id" ref="account_cutoff_base.res_config_settings_view_form"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@name='account_closing_cutoffs']" position="inside"> | ||
<div class="col-xs-12 col-md-12 o_setting_box"> | ||
<div class="o_setting_left_pane"> | ||
</div> | ||
<div class="o_setting_right_pane"> | ||
<label string="Cutoff prepaid"/> | ||
<div class="content-group"> | ||
<div class="row mt16"> | ||
<label string="Account for Prepaid Expense" class="col-md-3 o_light_label"/> | ||
<field name="default_prepaid_expense_account_id" /> | ||
<label string="Account for Prepaid Revenue" class="col-md-3 o_light_label"/> | ||
<field name="default_prepaid_revenue_account_id" /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</data> | ||
</odoo> |