Skip to content

Commit

Permalink
Allow to configure different account for refunds (credit notes)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaudoux committed Nov 17, 2023
1 parent fe8cedb commit e664e13
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
12 changes: 12 additions & 0 deletions account_cutoff_base/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,18 @@ msgstr "La date de provision n'est pas définie."
msgid "Default Account for Accrued Expenses"
msgstr "Compte par défaut pour les charges à payer"

#. module: account_cutoff_base
#: model:ir.model.fields,field_description:account_cutoff_base.field_res_company__default_accrued_revenue_return_account_id
#: model:ir.model.fields,field_description:account_cutoff_base.field_res_config_settings__dft_accrued_revenue_return_account_id
msgid "Default Account for Accrued Revenues"
msgstr "Compte par défaut pour les notes de crédit à établir"

#. module: account_cutoff_base
#: model:ir.model.fields,field_description:account_cutoff_base.field_res_company__default_accrued_expense_return_account_id
#: model:ir.model.fields,field_description:account_cutoff_base.field_res_config_settings__dft_accrued_expense_return_account_id
msgid "Default Account for Accrued Expenses"
msgstr "Compte par défaut pour les notes de crédit à recevoir"

#. module: account_cutoff_base
#: model:ir.model.fields,field_description:account_cutoff_base.field_res_company__default_accrued_revenue_account_id
#: model:ir.model.fields,field_description:account_cutoff_base.field_res_config_settings__dft_accrued_revenue_account_id
Expand Down
10 changes: 10 additions & 0 deletions account_cutoff_base/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,13 @@ class ResCompany(models.Model):
string="Default Account for Prepaid Expense",
check_company=True,
)
default_accrued_revenue_return_account_id = fields.Many2one(
"account.account",
string="Default Account for Accrued Revenues Refunds",
check_company=True,
)
default_accrued_expense_return_account_id = fields.Many2one(
"account.account",
string="Default Account for Accrued Expenses Refunds",
check_company=True,
)
20 changes: 20 additions & 0 deletions account_cutoff_base/views/res_config_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,26 @@
options="{'no_create_edit': True, 'no_open': True}"
/>
</div>
<div class="row" id="dft_accrued_revenue_return_account_id">
<label
for="dft_accrued_revenue_return_account_id"
class="col-md-5"
/>
<field
name="dft_accrued_revenue_return_account_id"
options="{'no_create_edit': True, 'no_open': True}"
/>
</div>
<div class="row" id="dft_accrued_expense_return_account_id">
<label
for="dft_accrued_expense_return_account_id"
class="col-md-5"
/>
<field
name="dft_accrued_expense_return_account_id"
options="{'no_create_edit': True, 'no_open': True}"
/>
</div>
</div>
</div>
</div>
Expand Down
10 changes: 10 additions & 0 deletions account_cutoff_base/wizards/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@ class ResConfigSettings(models.TransientModel):
readonly=False,
domain="[('deprecated', '=', False), ('company_id', '=', company_id)]",
)
dft_accrued_revenue_return_account_id = fields.Many2one(
related="company_id.default_accrued_revenue_return_account_id",
readonly=False,
domain="[('deprecated', '=', False), ('company_id', '=', company_id)]",
)
dft_accrued_expense_return_account_id = fields.Many2one(
related="company_id.default_accrued_expense_return_account_id",
readonly=False,
domain="[('deprecated', '=', False), ('company_id', '=', company_id)]",
)

0 comments on commit e664e13

Please sign in to comment.