Compare commits
85 Commits
14.0-stock
...
14-formatL
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a7475a761 | ||
|
|
ce7a3a382a | ||
|
|
16e7233adb | ||
|
|
6e54d026a6 | ||
|
|
ed1a6641ce | ||
|
|
51aa9bb58f | ||
|
|
47b7b4a133 | ||
|
|
99c1f45951 | ||
|
|
e33453c1a5 | ||
|
|
4804917f37 | ||
|
|
4b658203cc | ||
|
|
e6d801a43a | ||
|
|
8510656382 | ||
|
|
c35c200ead | ||
|
|
1b99fedd38 | ||
|
|
e155a7b821 | ||
|
|
cec64f83d8 | ||
|
|
3e7298f465 | ||
|
|
82b910491a | ||
|
|
7a3f5cd05b | ||
|
|
1d96cc4c83 | ||
|
|
2ff3ea6dcd | ||
|
|
a1f8ab32dd | ||
|
|
f3a6cfade6 | ||
|
|
b8203ae42a | ||
|
|
02d9dee32e | ||
|
|
04b363f8a6 | ||
|
|
f3b5f85fc9 | ||
|
|
d7f6a2b9f8 | ||
|
|
2a0b1342e7 | ||
|
|
db33820a57 | ||
|
|
4c067fef09 | ||
|
|
88452b7930 | ||
|
|
a6305eb581 | ||
|
|
d2a8b77c22 | ||
|
|
467ce47306 | ||
|
|
ff0bdc1b8d | ||
|
|
254a97edd3 | ||
|
|
162f0b7874 | ||
|
|
ee8bf2ea17 | ||
|
|
97c20fed73 | ||
|
|
856bca4ccf | ||
|
|
0d5346d856 | ||
|
|
940fe43614 | ||
|
|
4e68c48110 | ||
|
|
7b8c35a384 | ||
|
|
0bbda6f265 | ||
|
|
c7c5d9172b | ||
|
|
4655e6b739 | ||
|
|
8bd83b0975 | ||
|
|
9367f7006e | ||
|
|
29b8ebb779 | ||
|
|
c33835957d | ||
|
|
73e700d2d2 | ||
|
|
0fa2024dab | ||
|
|
5144b039a5 | ||
|
|
0e237d26cb | ||
|
|
b252bdff34 | ||
|
|
550704288d | ||
|
|
320cfff25f | ||
|
|
26a7a42e8c | ||
|
|
3ca4553eb5 | ||
|
|
309d466374 | ||
|
|
61f43e5d02 | ||
|
|
6d847dcbe9 | ||
|
|
85b4cc25eb | ||
|
|
901a0e5816 | ||
|
|
569b3fea1a | ||
|
|
60589b1743 | ||
|
|
5ce7ed3fe7 | ||
|
|
ab3562a737 | ||
|
|
28c6aca721 | ||
|
|
b353bb14a5 | ||
|
|
282e7142db | ||
|
|
763928c286 | ||
|
|
4774b879fa | ||
|
|
18a5c22160 | ||
|
|
8f87df3f3d | ||
|
|
6af447974c | ||
|
|
46f2e0e01d | ||
|
|
ad8edd00d2 | ||
|
|
97d57e40eb | ||
|
|
fcf67f4fd9 | ||
|
|
89f81053cd | ||
|
|
b867dd6d01 |
@@ -1,10 +1,10 @@
|
||||
# Copyright 2017-2023 Akretion France (http://www.akretion.com/)
|
||||
# Copyright 2017-2024 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Bank Reconciliation Report",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "14.0.2.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "Akretion",
|
||||
"website": "https://github.com/akretion/odoo-usability",
|
||||
|
||||
@@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-01-13 10:31+0000\n"
|
||||
"PO-Revision-Date: 2023-01-13 10:31+0000\n"
|
||||
"POT-Creation-Date: 2024-10-23 10:04+0000\n"
|
||||
"PO-Revision-Date: 2024-10-23 10:04+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -17,6 +17,7 @@ msgstr ""
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "Amount"
|
||||
msgstr "Montant"
|
||||
@@ -27,6 +28,12 @@ msgstr "Montant"
|
||||
msgid "Balance %s:"
|
||||
msgstr "Solde %s :"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "Bank Balance:"
|
||||
msgstr "Solde bancaire :"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.model.fields,field_description:account_bank_reconciliation_summary_xlsx.field_bank_reconciliation_report_wizard__journal_ids
|
||||
msgid "Bank Journals"
|
||||
@@ -49,7 +56,7 @@ msgstr "Rapport de rapprochement bancaire"
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.model,name:account_bank_reconciliation_summary_xlsx.model_bank_reconciliation_report_wizard
|
||||
msgid "Bank Reconciliation Report Wizard"
|
||||
msgstr "Assistant rapport de rapprochement bancaire"
|
||||
msgstr "Assistant de rapport de rapprochement bancaire"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.actions.report,name:account_bank_reconciliation_summary_xlsx.bank_reconciliation_xlsx
|
||||
@@ -96,17 +103,36 @@ msgstr "Créé le"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "Currency"
|
||||
msgstr "Devise"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#: model:ir.model.fields,field_description:account_bank_reconciliation_summary_xlsx.field_bank_reconciliation_report_wizard__date
|
||||
#, python-format
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
msgstr "Date"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "Description"
|
||||
msgstr "Description"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "Difference:"
|
||||
msgstr "Écart :"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.model.fields,field_description:account_bank_reconciliation_summary_xlsx.field_bank_reconciliation_report_wizard__display_name
|
||||
#: model:ir.model.fields,field_description:account_bank_reconciliation_summary_xlsx.field_report_bank_reconciliation_xlsx__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
msgstr "Nom affiché"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.model.fields.selection,name:account_bank_reconciliation_summary_xlsx.selection__bank_reconciliation_report_wizard__move_state__draft_posted
|
||||
@@ -123,13 +149,13 @@ msgstr "Écritures"
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model_terms:ir.ui.view,arch_db:account_bank_reconciliation_summary_xlsx.bank_reconciliation_report_wizard_form
|
||||
msgid "Export XLSX"
|
||||
msgstr ""
|
||||
msgstr "Exporter en XLSX"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "Generated on %s"
|
||||
msgstr "Généré le %s"
|
||||
msgid "Generated from Odoo on %s by %s"
|
||||
msgstr "Généré par Odoo le %s par %s"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.model.fields,field_description:account_bank_reconciliation_summary_xlsx.field_bank_reconciliation_report_wizard__id
|
||||
@@ -143,6 +169,18 @@ msgstr ""
|
||||
msgid "Journal"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "Journal Entry"
|
||||
msgstr "Pièce"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "Justification:"
|
||||
msgstr "Justification :"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
@@ -153,23 +191,17 @@ msgstr "Libellé"
|
||||
#: model:ir.model.fields,field_description:account_bank_reconciliation_summary_xlsx.field_bank_reconciliation_report_wizard____last_update
|
||||
#: model:ir.model.fields,field_description:account_bank_reconciliation_summary_xlsx.field_report_bank_reconciliation_xlsx____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
msgstr "Dernière modification le"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.model.fields,field_description:account_bank_reconciliation_summary_xlsx.field_bank_reconciliation_report_wizard__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
msgstr "Dernière mise à jour par"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.model.fields,field_description:account_bank_reconciliation_summary_xlsx.field_bank_reconciliation_report_wizard__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "Move Number"
|
||||
msgstr "Numéro de pièce"
|
||||
msgstr "Dernière mise à jour le"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
@@ -179,10 +211,23 @@ msgstr "Aucun journal de banque sélectionné."
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "None"
|
||||
msgstr "Aucun"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"On bank journal %(journal)s which is configured with currency "
|
||||
"%(journal_currency)s, the account %(account)s must be configured with the "
|
||||
"same currency (current account currency: %(account_currency)s)."
|
||||
msgstr ""
|
||||
"Sur le journal de banque %(journal)s qui est configuré avec la devise "
|
||||
"%(journal_currency)s, le compte %(account)s doit être configuré avec la même"
|
||||
" devise (devise actuelle du compte : %(account_currency)s)."
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
@@ -211,3 +256,13 @@ msgstr "Sous-total :"
|
||||
#, python-format
|
||||
msgid "TOTAL:"
|
||||
msgstr "TOTAL :"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"The are %(count)s journal items in account %(account)s that have a currency "
|
||||
"other than %(currency)s or where currency is not set."
|
||||
msgstr ""
|
||||
"Il y a %(count)s écritures comptables dans le compte %(account)s qui ont une"
|
||||
" devise autre que %(currency)s ou dont la devise n'est pas définie."
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2023 Akretion France (http://www.akretion.com/)
|
||||
# Copyright 2017-2024 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
@@ -14,32 +14,19 @@ class BankReconciliationXlsx(models.AbstractModel):
|
||||
_description = "Bank Reconciliation XLSX Report"
|
||||
_inherit = "report.report_xlsx.abstract"
|
||||
|
||||
def _domain_add_move_state(self, wizard, domain):
|
||||
if wizard.move_state == 'posted':
|
||||
domain.append(('parent_state', '=', 'posted'))
|
||||
elif wizard.move_state == 'draft_posted':
|
||||
domain.append(('parent_state', 'in', ('draft', 'posted')))
|
||||
|
||||
def _get_account_balance(self, account, wizard):
|
||||
def _prepare_payment_move_lines(self, jdi, account, unreconciled_only=True):
|
||||
domain = [
|
||||
('account_id', '=', account.id),
|
||||
('date', '<=', wizard.date),
|
||||
('company_id', '=', wizard.company_id.id),
|
||||
]
|
||||
self._domain_add_move_state(wizard, domain)
|
||||
res_rg = self.env['account.move.line'].read_group(domain, ['balance:sum'], [])
|
||||
account_bal = res_rg and res_rg[0].get('balance', 0.0) or 0.0
|
||||
return account_bal
|
||||
|
||||
def _prepare_payment_move_lines(self, journal, account, wizard, unreconciled_only=True):
|
||||
domain = [
|
||||
("company_id", "=", wizard.company_id.id),
|
||||
("company_id", "=", jdi['company'].id),
|
||||
("account_id", "=", account.id),
|
||||
("journal_id", "=", journal.id),
|
||||
("date", "<=", wizard.date),
|
||||
("journal_id", "=", jdi['journal'].id),
|
||||
("date", "<=", jdi['wizard'].date),
|
||||
]
|
||||
if jdi['wizard'].move_state == 'posted':
|
||||
domain.append(('parent_state', '=', 'posted'))
|
||||
elif jdi['wizard'].move_state == 'draft_posted':
|
||||
domain.append(('parent_state', 'in', ('draft', 'posted')))
|
||||
if unreconciled_only:
|
||||
limit_datetime_naive = datetime.combine(wizard.date, datetime.max.time())
|
||||
limit_datetime_naive = datetime.combine(jdi['wizard'].date, datetime.max.time())
|
||||
tz = pytz.timezone(self.env.user.tz)
|
||||
limit_datetime_aware = tz.localize(limit_datetime_naive)
|
||||
limit_datetime_utc = limit_datetime_aware.astimezone(pytz.utc)
|
||||
@@ -47,7 +34,6 @@ class BankReconciliationXlsx(models.AbstractModel):
|
||||
domain += [
|
||||
'|', ('full_reconcile_id', '=', False),
|
||||
('full_reconcile_id.create_date', '>', limit_datetime)]
|
||||
self._domain_add_move_state(wizard, domain)
|
||||
mlines = self.env["account.move.line"].search(domain)
|
||||
res = []
|
||||
for mline in mlines:
|
||||
@@ -60,13 +46,18 @@ class BankReconciliationXlsx(models.AbstractModel):
|
||||
):
|
||||
cpart.append(line.account_id.code)
|
||||
counterpart = " ,".join(cpart)
|
||||
if jdi['currency'] == mline.currency_id:
|
||||
amount = mline.amount_currency
|
||||
else:
|
||||
amount = mline.currency_id._convert(
|
||||
mline.amount_currency, jdi['currency'], jdi['company'], mline.date)
|
||||
res.append(
|
||||
{
|
||||
"date": mline.date,
|
||||
"ref": move.ref or "",
|
||||
"label": mline.name,
|
||||
"partner": mline.partner_id.display_name or "",
|
||||
"amount": mline.balance,
|
||||
"amount": amount,
|
||||
"move_name": move.name,
|
||||
"counterpart": counterpart,
|
||||
}
|
||||
@@ -74,27 +65,31 @@ class BankReconciliationXlsx(models.AbstractModel):
|
||||
return res
|
||||
|
||||
def _write_move_lines_block(self, jdi, row, account, add2total=True):
|
||||
# Returns row
|
||||
# For suspense lines, it may not add any cells if there are no suspense lines
|
||||
# => in this case, it doesn't increment row
|
||||
# If it adds cells, it returns row + 2 to add 2 empty rows at the end
|
||||
sheet = jdi['sheet']
|
||||
style = jdi['style']
|
||||
style_suffix = not add2total and '_warn' or ''
|
||||
subtotal = 0.0
|
||||
mlines = self._prepare_payment_move_lines(jdi['journal'], account, jdi['wizard'])
|
||||
mlines = self._prepare_payment_move_lines(jdi, account)
|
||||
if mlines or add2total:
|
||||
sheet.write(row, 0, '%s %s' % (account.name, account.code), style['title' + style_suffix])
|
||||
sheet.write(row, 1, "", style['title' + style_suffix])
|
||||
sheet.write(row, 0, '%s %s' % (account.name, account.code), style[f"title{style_suffix}"])
|
||||
sheet.write(row, 1, "", style[f"title{style_suffix}"])
|
||||
|
||||
if not mlines:
|
||||
if add2total:
|
||||
sheet.write(row, 2, _("None"), style['none'])
|
||||
else:
|
||||
return
|
||||
return row
|
||||
else:
|
||||
row += 1
|
||||
col_labels = [
|
||||
_("Date"),
|
||||
_("Partner"),
|
||||
_("Amount"),
|
||||
_("Move Number"),
|
||||
_("Journal Entry"),
|
||||
_("Counter-part"),
|
||||
_("Ref."),
|
||||
_("Label"),
|
||||
@@ -108,7 +103,7 @@ class BankReconciliationXlsx(models.AbstractModel):
|
||||
for mline in mlines:
|
||||
sheet.write(row, 0, mline["date"], style['regular_date'])
|
||||
sheet.write(row, 1, mline["partner"], style['regular'])
|
||||
sheet.write(row, 2, mline["amount"], style['currency'])
|
||||
sheet.write(row, 2, mline["amount"], style[jdi['currency']])
|
||||
sheet.write(row, 3, mline["move_name"], style['regular'])
|
||||
sheet.write(row, 4, mline["counterpart"], style['regular'])
|
||||
sheet.write(row, 5, mline["ref"], style['regular'])
|
||||
@@ -118,18 +113,20 @@ class BankReconciliationXlsx(models.AbstractModel):
|
||||
end_line = row
|
||||
|
||||
for col in range(1):
|
||||
sheet.write(row, col, "", style['title' + style_suffix])
|
||||
sheet.write(row, 1, _("Sub-total:") + ' ', style['title_right' + style_suffix])
|
||||
sheet.write(row, col, "", style[f"title{style_suffix}"])
|
||||
sheet.write(row, 1, _("Sub-total:") + ' ', style[f"title_right{style_suffix}"])
|
||||
|
||||
formula = '=SUM(%s%d:%s%d)' % (
|
||||
jdi['total_col'], start_line, jdi['total_col'], end_line)
|
||||
sheet.write_formula(row, 2, formula, style['currency_bg' + style_suffix], subtotal)
|
||||
formula = f"=SUM({jdi['total_col']}{start_line}:{jdi['total_col']}{end_line})"
|
||||
sheet.write_formula(row, 2, formula, style[f"{jdi['currency']}_bg{style_suffix}"], subtotal)
|
||||
if add2total:
|
||||
jdi['total'] += subtotal
|
||||
jdi['total_formula'] += '+%s%d' % (jdi['total_col'], row + 1)
|
||||
return row
|
||||
jdi['total_formula'] += f"+{jdi['total_col']}{row + 1}"
|
||||
return row + 2
|
||||
|
||||
def generate_xlsx_report(self, workbook, data, wizard):
|
||||
lang = self.env.user.lang
|
||||
self = self.with_context(lang=lang)
|
||||
wizard = wizard.with_context(lang=lang)
|
||||
if not wizard.journal_ids:
|
||||
raise UserError(_("No bank journal selected."))
|
||||
date_dt = wizard.date
|
||||
@@ -137,15 +134,21 @@ class BankReconciliationXlsx(models.AbstractModel):
|
||||
style = self._get_style(workbook, company)
|
||||
move_state_label = dict(
|
||||
wizard.fields_get('move_state', 'selection')['move_state']['selection'])
|
||||
generated_on_label = _('Generated on %s') % format_datetime(
|
||||
self.env, datetime.utcnow())
|
||||
generated_on_label = _('Generated from Odoo on %s by %s') % (
|
||||
format_datetime(self.env, datetime.utcnow()),
|
||||
self.env.user.name)
|
||||
for journal in wizard.journal_ids:
|
||||
row = 0
|
||||
sheet = workbook.add_worksheet(journal.code or journal.name)
|
||||
bank_account = journal.default_account_id
|
||||
jdi = {
|
||||
'wizard': wizard,
|
||||
'company': company,
|
||||
'journal': journal,
|
||||
'currency': journal.currency_id or company.currency_id,
|
||||
'bank_account': bank_account,
|
||||
'style': style,
|
||||
'workbook': workbook,
|
||||
'sheet': sheet,
|
||||
'total': 0.0,
|
||||
'total_formula': '=',
|
||||
@@ -169,7 +172,7 @@ class BankReconciliationXlsx(models.AbstractModel):
|
||||
sheet.set_column(6, 6, 60)
|
||||
row += 3
|
||||
sheet.write(row, 0, _("Company"), style['wizard_field'])
|
||||
sheet.write(row, 1, wizard.company_id.display_name, style['wizard_value'])
|
||||
sheet.write(row, 1, company.display_name, style['wizard_value'])
|
||||
row += 1
|
||||
sheet.write(row, 0, _("Date"), style['wizard_field'])
|
||||
sheet.write(row, 1, date_dt, style['wizard_value_date'])
|
||||
@@ -177,51 +180,121 @@ class BankReconciliationXlsx(models.AbstractModel):
|
||||
sheet.write(row, 0, _("Journal"), style['wizard_field'])
|
||||
sheet.write(row, 1, journal.display_name, style['wizard_value'])
|
||||
row += 1
|
||||
sheet.write(row, 0, _("Currency"), style['wizard_field'])
|
||||
sheet.write(row, 1, jdi['currency'].name, style['wizard_value'])
|
||||
row += 1
|
||||
sheet.write(row, 0, _("Entries"), style['wizard_field'])
|
||||
sheet.write(row, 1, move_state_label[wizard.move_state], style['wizard_value'])
|
||||
|
||||
# Setup check
|
||||
if journal.currency_id and journal.currency_id != company.currency_id:
|
||||
if journal.currency_id != bank_account.currency_id:
|
||||
raise UserError(_(
|
||||
"On bank journal %(journal)s which is configured with currency "
|
||||
"%(journal_currency)s, the account %(account)s must be configured "
|
||||
"with the same currency (current account currency: %(account_currency)s).",
|
||||
journal=journal.display_name,
|
||||
journal_currency=journal.currency_id.name,
|
||||
account=bank_account.display_name,
|
||||
account_currency=bank_account.currency_id.name or _('None')))
|
||||
bad_line_count = self.env['account.move.line'].search_count([
|
||||
('company_id', '=', company.id),
|
||||
('journal_id', '=', journal.id),
|
||||
('account_id', '=', bank_account.id),
|
||||
('currency_id', '!=', jdi['currency'].id),
|
||||
])
|
||||
if bad_line_count:
|
||||
raise UserError(_(
|
||||
"The are %(count)s journal items in account %(account)s "
|
||||
"that have a currency other than %(currency)s or where "
|
||||
"currency is not set.",
|
||||
count=bad_line_count,
|
||||
account=bank_account.display_name,
|
||||
currency=jdi['currency'].name))
|
||||
|
||||
# 1) Show balance of bank account
|
||||
row += 3
|
||||
bank_account = journal.default_account_id
|
||||
for col in range(1):
|
||||
sheet.write(row, col, "", style['title'])
|
||||
sheet.write(row, 1, _("Balance %s:") % bank_account.code + ' ', style['title_right'])
|
||||
account_bal = self._get_account_balance(bank_account, wizard)
|
||||
if wizard.move_state == 'posted':
|
||||
domain = [('parent_state', '=', 'posted')]
|
||||
else:
|
||||
# by default, the native method _get_journal_bank_account_balance()
|
||||
# has ('parent_state', '!=', 'cancel')
|
||||
domain = None
|
||||
account_bal, nb_lines = journal._get_journal_bank_account_balance(domain=domain)
|
||||
|
||||
sheet.write(row, 2, account_bal, style['currency_bg'])
|
||||
sheet.write(row, 2, account_bal, style[f"{jdi['currency']}_bg"])
|
||||
jdi['total'] += account_bal
|
||||
jdi['total_formula'] += '%s%d' % (jdi['total_col'], row + 1)
|
||||
jdi['total_formula'] += f"{jdi['total_col']}{row + 1}"
|
||||
|
||||
row += 2
|
||||
# 2) Show payment lines IN (debit)
|
||||
debit_account = journal.payment_debit_account_id
|
||||
row = self._write_move_lines_block(jdi, row, debit_account)
|
||||
row += 2
|
||||
# 3) Show payment lines OUT (credit)
|
||||
credit_account = journal.payment_credit_account_id
|
||||
row = self._write_move_lines_block(jdi, row, credit_account)
|
||||
row += 2
|
||||
|
||||
for col in range(1):
|
||||
sheet.write(row, col, "", style['title'])
|
||||
sheet.write(row, 1, _("TOTAL:") + ' ', style['title_right'])
|
||||
sheet.write_formula(
|
||||
row, 2, jdi['total_formula'], style['currency_bg'], jdi['total'])
|
||||
row += 3
|
||||
row, 2, jdi['total_formula'], style[f"{jdi['currency']}_bg"], jdi['total'])
|
||||
total_row = row
|
||||
row += 2
|
||||
|
||||
# 4) Show suspense account lines
|
||||
row = self._write_move_lines_block(
|
||||
jdi, row, journal.suspense_account_id, add2total=False)
|
||||
|
||||
# Static cells
|
||||
for col in range(1):
|
||||
sheet.write(row, col, "", style['title'])
|
||||
sheet.write(row, 1, _("Bank Balance:") + ' ', style['title_right'])
|
||||
sheet.write(row, 2, 0, style[f"{jdi['currency']}_bg_manual"])
|
||||
bank_bal_row = row
|
||||
row += 2
|
||||
for col in range(1):
|
||||
sheet.write(row, col, "", style['title'])
|
||||
sheet.write(row, 1, _("Difference:") + ' ', style['title_right'])
|
||||
sheet.write_formula(
|
||||
row, 2, f"={jdi['total_col']}{total_row + 1}-{jdi['total_col']}{bank_bal_row + 1}",
|
||||
style[f"{jdi['currency']}_bg"], jdi['total'])
|
||||
row += 2
|
||||
for col in range(1):
|
||||
sheet.write(row, col, "", style['title'])
|
||||
sheet.write(row, 1, _("Justification:") + ' ', style['title_right'])
|
||||
justif_lines = 6
|
||||
sheet.write_formula(
|
||||
row, 2, f"=SUM({jdi['total_col']}{row+3}:{jdi['total_col']}{row+3+justif_lines-1})",
|
||||
style[f"{jdi['currency']}_bg"], 0)
|
||||
row += 1
|
||||
col_labels = [
|
||||
_("Date"),
|
||||
_("Description"),
|
||||
_("Amount"),
|
||||
]
|
||||
col = 0
|
||||
for col_label in col_labels:
|
||||
sheet.write(row, col, col_label, style['col_header'])
|
||||
col += 1
|
||||
for x in range(justif_lines):
|
||||
row += 1
|
||||
sheet.write(row, 0, "", style['regular_date'])
|
||||
sheet.write(row, 1, "", style['regular'])
|
||||
sheet.write(row, 2, "", style[jdi['currency']])
|
||||
|
||||
def _get_style(self, workbook, company):
|
||||
style = {}
|
||||
font_size = 10
|
||||
light_grey = "#eeeeee"
|
||||
title_blue = "#e6e6fa"
|
||||
light_blue = "#e0edff"
|
||||
subtotal_orange = "#ffcc00"
|
||||
title_warn = "#ff9999"
|
||||
subtotal_warn = "#ffff99"
|
||||
light_purple = "#ffdeff"
|
||||
amount_manual = "#ffeeab"
|
||||
title_warn = "#ff9999"
|
||||
lang_code = self.env.user.lang
|
||||
lang = False
|
||||
if lang_code:
|
||||
@@ -249,7 +322,7 @@ class BankReconciliationXlsx(models.AbstractModel):
|
||||
)
|
||||
title_style = {
|
||||
"bold": True,
|
||||
"bg_color": title_blue,
|
||||
"bg_color": light_blue,
|
||||
"font_size": font_size,
|
||||
"align": "left",
|
||||
}
|
||||
@@ -257,7 +330,7 @@ class BankReconciliationXlsx(models.AbstractModel):
|
||||
style['title'] = workbook.add_format(dict(title_style))
|
||||
style['wizard_field'] = workbook.add_format(dict(title_style, bg_color=light_grey))
|
||||
wizard_value_style = {
|
||||
"bg_color": light_purple,
|
||||
"bg_color": light_blue,
|
||||
"bold": True,
|
||||
"font_size": font_size,
|
||||
"align": "left",
|
||||
@@ -274,23 +347,29 @@ class BankReconciliationXlsx(models.AbstractModel):
|
||||
dict(title_style, align="left", bg_color=title_warn))
|
||||
style['title_right_warn'] = workbook.add_format(
|
||||
dict(title_style, align="right", bg_color=title_warn))
|
||||
style['regular'] = workbook.add_format({"font_size": font_size})
|
||||
style['regular'] = workbook.add_format({"font_size": font_size, "border": 1})
|
||||
if "%" in xls_date_format:
|
||||
# fallback
|
||||
xls_date_format = "yyyy-mm-dd"
|
||||
style['regular_date'] = workbook.add_format(
|
||||
{"num_format": xls_date_format, "font_size": font_size, "align": "left"}
|
||||
)
|
||||
cur_format = "#,##0.00 %s" % (
|
||||
company.currency_id.symbol or company.currency_id.name
|
||||
{"num_format": xls_date_format, "font_size": font_size, "align": "left", "border": 1}
|
||||
)
|
||||
for currency in self.env['res.currency'].search([]):
|
||||
symbol = currency.symbol or currency.name
|
||||
decimals = '0' * currency.decimal_places
|
||||
if currency.position == 'before':
|
||||
cur_format = f"{symbol} #,##0.{decimals}"
|
||||
else:
|
||||
cur_format = f"#,##0.{decimals} {symbol}"
|
||||
# It seems that Excel replaces automatically the decimal
|
||||
# and thousand separator by those of the language under which
|
||||
# Excel runs
|
||||
currency_style = {"num_format": cur_format, "font_size": font_size}
|
||||
style['currency'] = workbook.add_format(currency_style)
|
||||
style['currency_bg'] = workbook.add_format(
|
||||
style[currency] = workbook.add_format(dict(currency_style, border=1))
|
||||
style[f'{currency}_bg'] = workbook.add_format(
|
||||
dict(currency_style, bg_color=subtotal_orange))
|
||||
style['currency_bg_warn'] = workbook.add_format(
|
||||
style[f'{currency}_bg_warn'] = workbook.add_format(
|
||||
dict(currency_style, bg_color=subtotal_warn))
|
||||
style[f'{currency}_bg_manual'] = workbook.add_format(
|
||||
dict(currency_style, bg_color=amount_manual))
|
||||
return style
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright 2017-2023 Akretion France (http://www.akretion.com/)
|
||||
Copyright 2017-2024 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -12,7 +12,6 @@
|
||||
<field name="report_type">xlsx</field>
|
||||
<field name="report_name">bank.reconciliation.xlsx</field>
|
||||
<field name="report_file">bank.reconciliation.xlsx</field>
|
||||
<!-- print_report_name doesn't work here... -->
|
||||
<field name="print_report_name">'bank_reconciliation-%s' % (object.date)</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
|
After Width: | Height: | Size: 9.2 KiB |
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright 2017-2020 Akretion France (http://www.akretion.com/)
|
||||
Copyright 2017-2024 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright 2018-2023 Akretion France (http://www.akretion.com/)
|
||||
Copyright 2018-2024 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -9,7 +9,7 @@
|
||||
<record id="account_journal_dashboard_kanban_view" model="ir.ui.view">
|
||||
<field
|
||||
name="name"
|
||||
>bank_reconciliation_summarry.account_journal_dashboard</field>
|
||||
>bank_reconciliation_summary.account_journal_dashboard</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.account_journal_dashboard_kanban_view" />
|
||||
<field name="arch" type="xml">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2023 Akretion France (http://www.akretion.com/)
|
||||
# Copyright 2017-2024 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright 2017-2023 Akretion France (http://www.akretion.com/)
|
||||
Copyright 2017-2024 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
68
account_default_report_without_paiement/README.rst
Normal file
@@ -0,0 +1,68 @@
|
||||
=======================================
|
||||
Account Default Report Without Paiement
|
||||
=======================================
|
||||
|
||||
..
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:2035514c3af2d372479b91ca5314fe2f5ff90523f11fb8cc874b4fac8b375f50
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
|
||||
:target: https://github.com/akretion/odoo-usability/tree/14.0/account_default_report_without_paiement
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
|
||||
This module switch the default account report to the one without paiement
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_default_report_without_paiement%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Akretion
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Kévin Roche <kevin.roche@akretion.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
.. |maintainer-Kev-Roche| image:: https://github.com/Kev-Roche.png?size=40px
|
||||
:target: https://github.com/Kev-Roche
|
||||
:alt: Kev-Roche
|
||||
|
||||
Current maintainer:
|
||||
|
||||
|maintainer-Kev-Roche|
|
||||
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/14.0/account_default_report_without_paiement>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute.
|
||||
0
account_default_report_without_paiement/__init__.py
Normal file
22
account_default_report_without_paiement/__manifest__.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright 2024 Akretion (https://www.akretion.com).
|
||||
# @author Kévin Roche <kevin.roche@akretion.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Account Default Report Without Paiement",
|
||||
"summary": "Account Default Report Without Paiement",
|
||||
"version": "14.0.1.0.0",
|
||||
"category": "reports",
|
||||
"website": "https://github.com/OCA/account",
|
||||
"author": "Akretion, Odoo Community Association (OCA)",
|
||||
"license": "AGPL-3",
|
||||
"maintainers":["Kev-Roche"],
|
||||
"application": False,
|
||||
"installable": True,
|
||||
"depends": [
|
||||
"account",
|
||||
],
|
||||
"data": [
|
||||
"data/data.xml",
|
||||
],
|
||||
}
|
||||
16
account_default_report_without_paiement/data/data.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!-- Copyright (C) 2024 Akretion (<http://www.akretion.com>).
|
||||
@author Kévin Roche <kevin.roche@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="account.account_invoices" model="ir.actions.report">
|
||||
<field name="report_name">account.report_invoice</field>
|
||||
<field name="report_file">account.report_invoice</field>
|
||||
</record>
|
||||
|
||||
<record id="account.account_invoices_without_payment" model="ir.actions.report">
|
||||
<field name="name">Factures avec paiement</field>
|
||||
<field name="report_name">account.report_invoice_with_payments</field>
|
||||
<field name="report_file">account.report_invoice_with_payments</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1 @@
|
||||
* Kévin Roche <kevin.roche@akretion.com>
|
||||
@@ -0,0 +1 @@
|
||||
This module switch the default account report to the one without paiement
|
||||
|
After Width: | Height: | Size: 9.2 KiB |
@@ -0,0 +1,418 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||
<title>Account Default Report Without Paiement</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
Despite the name, some widely supported CSS2 features are used.
|
||||
|
||||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: gray; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic, pre.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="account-default-report-without-paiement">
|
||||
<h1 class="title">Account Default Report Without Paiement</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:2035514c3af2d372479b91ca5314fe2f5ff90523f11fb8cc874b4fac8b375f50
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/akretion/odoo-usability/tree/14.0/account_default_report_without_paiement"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p>This module switch the default account report to the one without paiement</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_default_report_without_paiement%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Akretion</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Kévin Roche <<a class="reference external" href="mailto:kevin.roche@akretion.com">kevin.roche@akretion.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
|
||||
<p>Current maintainer:</p>
|
||||
<p><a class="reference external image-reference" href="https://github.com/Kev-Roche"><img alt="Kev-Roche" src="https://github.com/Kev-Roche.png?size=40px" /></a></p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/14.0/account_default_report_without_paiement">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,2 +1 @@
|
||||
from . import account_invoice
|
||||
from . import account_invoice_report
|
||||
from . import models
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Margin',
|
||||
'version': '12.0.1.0.0',
|
||||
'version': '14.0.1.0.0',
|
||||
'category': 'Invoicing Management',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Copy standard price on invoice line and compute margins',
|
||||
@@ -15,10 +15,10 @@ This module has been written by Alexis de Lattre from Akretion
|
||||
<alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'website': 'https://github.com/akretion/odoo-usability',
|
||||
'depends': ['account'],
|
||||
'data': [
|
||||
'account_invoice_view.xml',
|
||||
'views/account_move.xml',
|
||||
],
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
# Copyright 2015-2019 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
import odoo.addons.decimal_precision as dp
|
||||
|
||||
|
||||
class AccountInvoiceLine(models.Model):
|
||||
_inherit = 'account.invoice.line'
|
||||
|
||||
standard_price_company_currency = fields.Float(
|
||||
string='Cost Price in Company Currency', readonly=True,
|
||||
digits=dp.get_precision('Product Price'),
|
||||
help="Cost price in company currency in the unit of measure "
|
||||
"of the invoice line (which may be different from the unit "
|
||||
"of measure of the product).")
|
||||
standard_price_invoice_currency = fields.Float(
|
||||
string='Cost Price in Invoice Currency', readonly=True,
|
||||
compute='_compute_margin', store=True,
|
||||
digits=dp.get_precision('Product Price'),
|
||||
help="Cost price in invoice currency in the unit of measure "
|
||||
"of the invoice line")
|
||||
margin_invoice_currency = fields.Monetary(
|
||||
string='Margin in Invoice Currency', readonly=True, store=True,
|
||||
compute='_compute_margin', currency_field='currency_id')
|
||||
margin_company_currency = fields.Monetary(
|
||||
string='Margin in Company Currency', readonly=True, store=True,
|
||||
compute='_compute_margin', currency_field='company_currency_id')
|
||||
margin_rate = fields.Float(
|
||||
string="Margin Rate", readonly=True, store=True,
|
||||
compute='_compute_margin',
|
||||
digits=(16, 2), help="Margin rate in percentage of the sale price")
|
||||
|
||||
@api.depends(
|
||||
'standard_price_company_currency', 'invoice_id.currency_id',
|
||||
'invoice_id.type', 'invoice_id.company_id',
|
||||
'invoice_id.date_invoice', 'quantity', 'price_subtotal')
|
||||
def _compute_margin(self):
|
||||
for il in self:
|
||||
standard_price_inv_cur = 0.0
|
||||
margin_inv_cur = 0.0
|
||||
margin_comp_cur = 0.0
|
||||
margin_rate = 0.0
|
||||
inv = il.invoice_id
|
||||
if inv and inv.type in ('out_invoice', 'out_refund'):
|
||||
# it works in _get_current_rate
|
||||
# even if we set date = False in context
|
||||
# standard_price_inv_cur is in the UoM of the invoice line
|
||||
date = inv._get_currency_rate_date() or\
|
||||
fields.Date.context_today(self)
|
||||
company = inv.company_id
|
||||
company_currency = company.currency_id
|
||||
standard_price_inv_cur =\
|
||||
company_currency._convert(
|
||||
il.standard_price_company_currency,
|
||||
inv.currency_id, company, date)
|
||||
margin_inv_cur =\
|
||||
il.price_subtotal - il.quantity * standard_price_inv_cur
|
||||
margin_comp_cur = inv.currency_id._convert(
|
||||
margin_inv_cur, company_currency, company, date)
|
||||
if il.price_subtotal:
|
||||
margin_rate = 100 * margin_inv_cur / il.price_subtotal
|
||||
# for a refund, margin should be negative
|
||||
# but margin rate should stay positive
|
||||
if inv.type == 'out_refund':
|
||||
margin_inv_cur *= -1
|
||||
margin_comp_cur *= -1
|
||||
il.standard_price_invoice_currency = standard_price_inv_cur
|
||||
il.margin_invoice_currency = margin_inv_cur
|
||||
il.margin_company_currency = margin_comp_cur
|
||||
il.margin_rate = margin_rate
|
||||
|
||||
# We want to copy standard_price on invoice line for customer
|
||||
# invoice/refunds. We can't do that via on_change of product_id,
|
||||
# because it is not always played when invoice is created from code
|
||||
# => we inherit write/create
|
||||
# We write standard_price_company_currency even on supplier invoice/refunds
|
||||
# because we don't have access to the 'type' of the invoice
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
if vals.get('product_id'):
|
||||
pp = self.env['product.product'].browse(vals['product_id'])
|
||||
std_price = pp.standard_price
|
||||
inv_uom_id = vals.get('uom_id')
|
||||
if inv_uom_id and inv_uom_id != pp.uom_id.id:
|
||||
inv_uom = self.env['uom.uom'].browse(inv_uom_id)
|
||||
std_price = pp.uom_id._compute_price(
|
||||
std_price, inv_uom)
|
||||
vals['standard_price_company_currency'] = std_price
|
||||
return super(AccountInvoiceLine, self).create(vals)
|
||||
|
||||
def write(self, vals):
|
||||
if not vals:
|
||||
vals = {}
|
||||
if 'product_id' in vals or 'uom_id' in vals:
|
||||
for il in self:
|
||||
if 'product_id' in vals:
|
||||
if vals.get('product_id'):
|
||||
pp = self.env['product.product'].browse(
|
||||
vals['product_id'])
|
||||
else:
|
||||
pp = False
|
||||
else:
|
||||
pp = il.product_id or False
|
||||
# uom_id is NOT a required field
|
||||
if 'uom_id' in vals:
|
||||
if vals.get('uom_id'):
|
||||
inv_uom = self.env['uom.uom'].browse(
|
||||
vals['uom_id'])
|
||||
else:
|
||||
inv_uom = False
|
||||
else:
|
||||
inv_uom = il.uom_id or False
|
||||
std_price = 0.0
|
||||
if pp:
|
||||
std_price = pp.standard_price
|
||||
if inv_uom and inv_uom != pp.uom_id:
|
||||
std_price = pp.uom_id._compute_price(
|
||||
std_price, inv_uom)
|
||||
il.write({'standard_price_company_currency': std_price})
|
||||
return super(AccountInvoiceLine, self).write(vals)
|
||||
|
||||
|
||||
class AccountInvoice(models.Model):
|
||||
_inherit = 'account.invoice'
|
||||
|
||||
margin_invoice_currency = fields.Monetary(
|
||||
string='Margin in Invoice Currency',
|
||||
compute='_compute_margin', store=True, readonly=True,
|
||||
currency_field='currency_id')
|
||||
margin_company_currency = fields.Monetary(
|
||||
string='Margin in Company Currency',
|
||||
compute='_compute_margin', store=True, readonly=True,
|
||||
currency_field='company_currency_id')
|
||||
|
||||
@api.depends(
|
||||
'type',
|
||||
'invoice_line_ids.margin_invoice_currency',
|
||||
'invoice_line_ids.margin_company_currency')
|
||||
def _compute_margin(self):
|
||||
res = self.env['account.invoice.line'].read_group(
|
||||
[('invoice_id', 'in', self.ids)],
|
||||
['invoice_id', 'margin_invoice_currency',
|
||||
'margin_company_currency'],
|
||||
['invoice_id'])
|
||||
for re in res:
|
||||
if re['invoice_id']:
|
||||
inv = self.browse(re['invoice_id'][0])
|
||||
if inv.type in ('out_invoice', 'out_refund'):
|
||||
inv.margin_invoice_currency = re['margin_invoice_currency']
|
||||
inv.margin_company_currency = re['margin_company_currency']
|
||||
@@ -1,60 +0,0 @@
|
||||
# Copyright 2018-2019 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountInvoiceReport(models.Model):
|
||||
_inherit = 'account.invoice.report'
|
||||
|
||||
margin = fields.Float(string='Margin', readonly=True)
|
||||
# why digits=0 ??? Why is it like that in the native "account" module
|
||||
user_currency_margin = fields.Float(
|
||||
string="Margin", compute='_compute_user_currency_margin', digits=0)
|
||||
|
||||
_depends = {
|
||||
'account.invoice': [
|
||||
'account_id', 'amount_total_company_signed',
|
||||
'commercial_partner_id', 'company_id',
|
||||
'currency_id', 'date_due', 'date_invoice', 'fiscal_position_id',
|
||||
'journal_id', 'number', 'partner_bank_id', 'partner_id',
|
||||
'payment_term_id', 'residual', 'state', 'type', 'user_id',
|
||||
],
|
||||
'account.invoice.line': [
|
||||
'account_id', 'invoice_id', 'price_subtotal', 'product_id',
|
||||
'quantity', 'uom_id', 'account_analytic_id',
|
||||
'margin_company_currency',
|
||||
],
|
||||
'product.product': ['product_tmpl_id'],
|
||||
'product.template': ['categ_id'],
|
||||
'uom.uom': ['category_id', 'factor', 'name', 'uom_type'],
|
||||
'res.currency.rate': ['currency_id', 'name'],
|
||||
'res.partner': ['country_id'],
|
||||
}
|
||||
|
||||
@api.depends('currency_id', 'date', 'margin')
|
||||
def _compute_user_currency_margin(self):
|
||||
user_currency = self.env.user.company_id.currency_id
|
||||
currency_rate = self.env['res.currency.rate'].search([
|
||||
('rate', '=', 1),
|
||||
'|',
|
||||
('company_id', '=', self.env.user.company_id.id),
|
||||
('company_id', '=', False)], limit=1)
|
||||
base_currency = currency_rate.currency_id
|
||||
for record in self:
|
||||
date = record.date or fields.Date.today()
|
||||
company = record.company_id
|
||||
record.user_currency_margin = base_currency._convert(
|
||||
record.margin, user_currency, company, date)
|
||||
|
||||
# TODO check for refunds
|
||||
def _sub_select(self):
|
||||
select_str = super(AccountInvoiceReport, self)._sub_select()
|
||||
select_str += ", SUM(ail.margin_company_currency) AS margin"
|
||||
return select_str
|
||||
|
||||
def _select(self):
|
||||
select_str = super(AccountInvoiceReport, self)._select()
|
||||
select_str += ", sub.margin AS margin"
|
||||
return select_str
|
||||
@@ -1,51 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2015-2017 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_invoice_line_form" model="ir.ui.view">
|
||||
<field name="name">margin.account.invoice.line.form</field>
|
||||
<field name="model">account.invoice.line</field>
|
||||
<field name="inherit_id" ref="account.view_invoice_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='analytic_tag_ids']/.." position="inside">
|
||||
<field name="standard_price_company_currency"
|
||||
string="Cost Price in Comp. Cur."
|
||||
groups="base.group_no_one"/>
|
||||
<field name="standard_price_invoice_currency"
|
||||
string="Cost Price in Inv. Cur."
|
||||
groups="base.group_no_one"/>
|
||||
<field name="margin_invoice_currency"
|
||||
string="Margin in Inv. Cur."
|
||||
groups="base.group_no_one"/>
|
||||
<field name="margin_company_currency"
|
||||
string="Margin in Comp. Cur."
|
||||
groups="base.group_no_one"/>
|
||||
<label for="margin_rate" groups="base.group_no_one"/>
|
||||
<div name="margin_rate" groups="base.group_no_one">
|
||||
<field name="margin_rate" class="oe_inline"/> %
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="invoice_form" model="ir.ui.view">
|
||||
<field name="name">margin.account.invoice.form</field>
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="move_id" position="after">
|
||||
<field name="margin_invoice_currency"
|
||||
string="Margin in Inv. Cur." groups="base.group_no_one"/>
|
||||
<field name="margin_company_currency"
|
||||
string="Margin in Comp. Cur." groups="base.group_no_one"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
2
account_invoice_margin/models/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import account_move
|
||||
from . import account_invoice_report
|
||||
36
account_invoice_margin/models/account_invoice_report.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# Copyright 2018-2019 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountInvoiceReport(models.Model):
|
||||
_inherit = 'account.invoice.report'
|
||||
|
||||
margin = fields.Float(string='Margin', readonly=True)
|
||||
|
||||
# added margin_company_currency on account.move.line
|
||||
_depends = {
|
||||
'account.move': [
|
||||
'name', 'state', 'move_type', 'partner_id', 'invoice_user_id', 'fiscal_position_id',
|
||||
'invoice_date', 'invoice_date_due', 'invoice_payment_term_id', 'partner_bank_id',
|
||||
],
|
||||
'account.move.line': [
|
||||
'quantity', 'price_subtotal', 'amount_residual', 'balance', 'amount_currency',
|
||||
'move_id', 'product_id', 'product_uom_id', 'account_id', 'analytic_account_id',
|
||||
'journal_id', 'company_id', 'currency_id', 'partner_id',
|
||||
'margin_company_currency',
|
||||
],
|
||||
'product.product': ['product_tmpl_id'],
|
||||
'product.template': ['categ_id'],
|
||||
'uom.uom': ['category_id', 'factor', 'name', 'uom_type'],
|
||||
'res.currency.rate': ['currency_id', 'name'],
|
||||
'res.partner': ['country_id'],
|
||||
}
|
||||
|
||||
@api.model
|
||||
def _select(self):
|
||||
select_str = super()._select()
|
||||
select_str += ", line.margin_company_currency * currency_table.rate AS margin"
|
||||
return select_str
|
||||
155
account_invoice_margin/models/account_move.py
Normal file
@@ -0,0 +1,155 @@
|
||||
# Copyright 2015-2021 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountMoveLine(models.Model):
|
||||
_inherit = 'account.move.line'
|
||||
|
||||
standard_price_company_currency = fields.Float(
|
||||
string='Unit Cost Price in Company Currency', readonly=True,
|
||||
digits='Product Price',
|
||||
help="Unit Cost price in company currency in the unit of measure "
|
||||
"of the invoice line (which may be different from the unit "
|
||||
"of measure of the product).")
|
||||
standard_price_invoice_currency = fields.Float(
|
||||
string='Unit Cost Price in Invoice Currency',
|
||||
compute='_compute_margin', store=True, digits='Product Price',
|
||||
help="Unit Cost price in invoice currency in the unit of measure "
|
||||
"of the invoice line.")
|
||||
margin_invoice_currency = fields.Monetary(
|
||||
string='Margin in Invoice Currency', store=True,
|
||||
compute='_compute_margin', currency_field='currency_id')
|
||||
margin_company_currency = fields.Monetary(
|
||||
string='Margin in Company Currency', store=True,
|
||||
compute='_compute_margin', currency_field='company_currency_id')
|
||||
margin_rate = fields.Float(
|
||||
string="Margin Rate", readonly=True, store=True,
|
||||
compute='_compute_margin',
|
||||
digits=(16, 2), help="Margin rate in percentage of the sale price")
|
||||
|
||||
@api.depends(
|
||||
'standard_price_company_currency', 'move_id.currency_id',
|
||||
'move_id.move_type', 'move_id.company_id',
|
||||
'move_id.invoice_date', 'quantity', 'price_subtotal')
|
||||
def _compute_margin(self):
|
||||
for ml in self:
|
||||
standard_price_inv_cur = 0.0
|
||||
margin_inv_cur = 0.0
|
||||
margin_comp_cur = 0.0
|
||||
margin_rate = 0.0
|
||||
move = ml.move_id
|
||||
if move.move_type and move.move_type in ('out_invoice', 'out_refund'):
|
||||
# it works in _get_current_rate
|
||||
# even if we set date = False in context
|
||||
# standard_price_inv_cur is in the UoM of the invoice line
|
||||
date = move.date or fields.Date.context_today(self)
|
||||
company = move.company_id
|
||||
company_currency = company.currency_id
|
||||
standard_price_inv_cur =\
|
||||
company_currency._convert(
|
||||
ml.standard_price_company_currency,
|
||||
ml.currency_id, company, date)
|
||||
margin_inv_cur =\
|
||||
ml.price_subtotal - ml.quantity * standard_price_inv_cur
|
||||
margin_comp_cur = move.currency_id._convert(
|
||||
margin_inv_cur, company_currency, company, date)
|
||||
if ml.price_subtotal:
|
||||
margin_rate = 100 * margin_inv_cur / ml.price_subtotal
|
||||
# for a refund, margin should be negative
|
||||
# but margin rate should stay positive
|
||||
if move.move_type == 'out_refund':
|
||||
margin_inv_cur *= -1
|
||||
margin_comp_cur *= -1
|
||||
ml.standard_price_invoice_currency = standard_price_inv_cur
|
||||
ml.margin_invoice_currency = margin_inv_cur
|
||||
ml.margin_company_currency = margin_comp_cur
|
||||
ml.margin_rate = margin_rate
|
||||
|
||||
# We want to copy standard_price on invoice line for customer
|
||||
# invoice/refunds. We can't do that via on_change of product_id,
|
||||
# because it is not always played when invoice is created from code
|
||||
# => we inherit write/create
|
||||
# We write standard_price_company_currency even on supplier invoice/refunds
|
||||
# because we don't have access to the 'type' of the invoice
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
for vals in vals_list:
|
||||
if vals.get('product_id') and not vals.get('display_type'):
|
||||
pp = self.env['product.product'].browse(vals['product_id'])
|
||||
std_price = pp.standard_price
|
||||
inv_uom_id = vals.get('product_uom_id')
|
||||
if inv_uom_id and inv_uom_id != pp.uom_id.id:
|
||||
inv_uom = self.env['uom.uom'].browse(inv_uom_id)
|
||||
std_price = pp.uom_id._compute_price(
|
||||
std_price, inv_uom)
|
||||
vals['standard_price_company_currency'] = std_price
|
||||
return super().create(vals_list)
|
||||
|
||||
def write(self, vals):
|
||||
if not vals:
|
||||
vals = {}
|
||||
if 'product_id' in vals or 'product_uom_id' in vals:
|
||||
for il in self:
|
||||
if 'product_id' in vals:
|
||||
if vals.get('product_id'):
|
||||
pp = self.env['product.product'].browse(
|
||||
vals['product_id'])
|
||||
else:
|
||||
pp = False
|
||||
else:
|
||||
pp = il.product_id or False
|
||||
# uom_id is NOT a required field
|
||||
if 'product_uom_id' in vals:
|
||||
if vals.get('product_uom_id'):
|
||||
inv_uom = self.env['uom.uom'].browse(
|
||||
vals['product_uom_id'])
|
||||
else:
|
||||
inv_uom = False
|
||||
else:
|
||||
inv_uom = il.uom_id or False
|
||||
std_price = 0.0
|
||||
if pp:
|
||||
std_price = pp.standard_price
|
||||
if inv_uom and inv_uom != pp.uom_id:
|
||||
std_price = pp.uom_id._compute_price(
|
||||
std_price, inv_uom)
|
||||
il.write({'standard_price_company_currency': std_price})
|
||||
return super().write(vals)
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
margin_invoice_currency = fields.Monetary(
|
||||
string='Margin in Invoice Currency',
|
||||
compute='_compute_margin', store=True,
|
||||
currency_field='currency_id')
|
||||
margin_company_currency = fields.Monetary(
|
||||
string='Margin in Company Currency',
|
||||
compute='_compute_margin', store=True,
|
||||
currency_field='company_currency_id')
|
||||
|
||||
@api.depends(
|
||||
'move_type',
|
||||
'invoice_line_ids.margin_invoice_currency',
|
||||
'invoice_line_ids.margin_company_currency')
|
||||
def _compute_margin(self):
|
||||
rg_res = self.env['account.move.line'].read_group(
|
||||
[
|
||||
('move_id', 'in', self.ids),
|
||||
('display_type', '=', False),
|
||||
('exclude_from_invoice_tab', '=', False),
|
||||
('move_id.move_type', 'in', ('out_invoice', 'out_refund')),
|
||||
],
|
||||
['move_id', 'margin_invoice_currency:sum', 'margin_company_currency:sum'],
|
||||
['move_id'])
|
||||
mapped_data = dict([(x['move_id'][0], {
|
||||
'margin_invoice_currency': x['margin_invoice_currency'],
|
||||
'margin_company_currency': x['margin_company_currency'],
|
||||
}) for x in rg_res])
|
||||
for move in self:
|
||||
move.margin_invoice_currency = mapped_data.get(move.id, {}).get('margin_invoice_currency')
|
||||
move.margin_company_currency = mapped_data.get(move.id, {}).get('margin_company_currency')
|
||||
BIN
account_invoice_margin/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
55
account_invoice_margin/views/account_move.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2024 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_move_form" model="ir.ui.view">
|
||||
<field name="name">margin.account.move.form</field>
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="sale_info_group" position="inside">
|
||||
<field name="margin_invoice_currency"
|
||||
groups="base.group_no_one"
|
||||
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
<field name="margin_company_currency"
|
||||
groups="base.group_no_one"
|
||||
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
</group>
|
||||
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='price_total']" position="after">
|
||||
<field name="standard_price_invoice_currency" optional="hide" attrs="{'column_invisible': [('parent.move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
<field name="margin_invoice_currency" optional="hide" attrs="{'column_invisible': [('parent.move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
<field name="margin_rate" optional="hide" string="Margin Rate (%)" attrs="{'column_invisible': [('parent.move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='invoice_line_ids']/form//field[@name='price_total']/.." position="inside">
|
||||
<field name="standard_price_company_currency"
|
||||
groups="base.group_no_one" attrs="{'invisible': [('parent.move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
<field name="standard_price_invoice_currency"
|
||||
groups="base.group_no_one" attrs="{'invisible': [('parent.move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
<field name="margin_invoice_currency"
|
||||
groups="base.group_no_one" attrs="{'invisible': [('parent.move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
<field name="margin_company_currency"
|
||||
groups="base.group_no_one" attrs="{'invisible': [('parent.move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
<label for="margin_rate" groups="base.group_no_one" attrs="{'invisible': [('parent.move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
<div name="margin_rate" groups="base.group_no_one" attrs="{'invisible': [('parent.move_type', 'not in', ('out_invoice', 'out_refund'))]}">
|
||||
<field name="margin_rate" class="oe_inline"/> %
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_invoice_tree" model="ir.ui.view">
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_invoice_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="amount_residual_signed" position="after">
|
||||
<field name="margin_company_currency" optional="hide" sum="1" invisible="context.get('default_move_type') not in ('out_invoice', 'out_refund')" string="Margin"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
BIN
account_invoice_update_wizard/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
@@ -11,7 +11,8 @@
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="button_draft" position="before">
|
||||
<button name="prepare_update_wizard" type="object" string="Update Invoice" states="posted" groups="account.group_account_invoice"/>
|
||||
<button name="prepare_update_wizard" type="object" string="Update Invoice" groups="account.group_account_invoice" attrs="{'invisible': ['|', ('state', '!=', 'posted'), ('move_type', '=', 'entry')]}"/>
|
||||
<button name="prepare_update_wizard" type="object" string="Update Entry" groups="account.group_account_invoice" attrs="{'invisible': ['|', ('state', '!=', 'posted'), ('move_type', '!=', 'entry')]}"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -21,6 +21,7 @@ class AccountMoveUpdate(models.TransientModel):
|
||||
invoice_payment_term_id = fields.Many2one(
|
||||
'account.payment.term', string='Payment Term')
|
||||
ref = fields.Char(string='Reference') # field label is customized in the view
|
||||
invoice_date = fields.Date()
|
||||
invoice_origin = fields.Char(string='Source Document')
|
||||
partner_bank_id = fields.Many2one(
|
||||
'res.partner.bank', string='Bank Account')
|
||||
@@ -30,7 +31,7 @@ class AccountMoveUpdate(models.TransientModel):
|
||||
@api.model
|
||||
def _simple_fields2update(self):
|
||||
'''List boolean, date, datetime, char, text fields'''
|
||||
return ['ref', 'invoice_origin']
|
||||
return ['ref', 'invoice_origin', 'invoice_date']
|
||||
|
||||
@api.model
|
||||
def _m2o_fields2update(self):
|
||||
@@ -226,6 +227,12 @@ class AccountMoveUpdate(models.TransientModel):
|
||||
inv.message_post(body=_(
|
||||
'Non-legal fields of invoice updated via the Invoice Update '
|
||||
'wizard.'))
|
||||
# Purge existing PDF
|
||||
report = self.env.ref("account.account_invoices")
|
||||
attachment = report.retrieve_attachment(inv)
|
||||
# attachment may be None
|
||||
if attachment:
|
||||
attachment.unlink()
|
||||
return True
|
||||
|
||||
|
||||
|
||||
@@ -15,13 +15,15 @@
|
||||
<field name="move_type" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field string="Bill Reference" attrs="{'invisible': [('move_type', 'not in', ('in_invoice', 'in_refund'))]}" name="ref"/>
|
||||
<field string="Bill Date" attrs="{'invisible': [('move_type', 'not in', ('in_invoice', 'in_refund'))]}" name="invoice_date"/>
|
||||
<field string="Supplier Bill Reference" attrs="{'invisible': [('move_type', 'not in', ('in_invoice', 'in_refund'))]}" name="ref"/>
|
||||
<field string="Customer Reference" attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}" name="ref"/>
|
||||
<field name="invoice_origin"/>
|
||||
<field string="Ref" attrs="{'invisible': [('move_type', '!=', 'entry')]}" name="ref"/>
|
||||
<field name="invoice_origin" attrs="{'invisible': [('move_type', '=', 'entry')]}"/>
|
||||
<!-- update of payment term is broken -->
|
||||
<!-- <field name="invoice_payment_term_id" widget="selection"/>-->
|
||||
<field name="partner_bank_id"/>
|
||||
<field name="user_id" options="{'no_open': True, 'no_create': True, 'no_create_edit': True}"/>
|
||||
<field name="partner_bank_id" attrs="{'invisible': [('move_type', '=', 'entry')]}"/>
|
||||
<field name="user_id" options="{'no_open': True, 'no_create': True, 'no_create_edit': True}" attrs="{'invisible': [('move_type', '=', 'entry')]}"/>
|
||||
</group>
|
||||
<group name="lines">
|
||||
<field name="line_ids" nolabel="1" widget="section_and_note_one2many">
|
||||
@@ -30,8 +32,8 @@
|
||||
<field name="display_type" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="quantity" attrs="{'invisible': [('display_type', '!=', False)]}"/>
|
||||
<field name="price_subtotal" attrs="{'invisible': [('display_type', '!=', False)]}"/>
|
||||
<field name="quantity" attrs="{'invisible': [('display_type', '!=', False)], 'column_invisible': [('parent.move_type', '=', 'entry')]}"/>
|
||||
<field name="price_subtotal" attrs="{'invisible': [('display_type', '!=', False)], 'column_invisible': [('parent.move_type', '=', 'entry')]}"/>
|
||||
<field name="analytic_account_id" attrs="{'invisible': [('display_type', '!=', False)]}" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="analytic_tag_ids" attrs="{'invisible': [('display_type', '!=', False)]}" groups="analytic.group_analytic_tags" widget="many2many_tags"/>
|
||||
</tree>
|
||||
|
||||
|
After Width: | Height: | Size: 9.2 KiB |
BIN
account_menu_usability/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
account_move_label_copy/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
@@ -1,2 +1 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
25
account_payment_line_manual_account/__manifest__.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# Copyright 2024 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Payment Line Manual Account',
|
||||
'version': '14.0.1.0.0',
|
||||
'category': 'Accounting',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Ability to select the account on payment lines without journal item',
|
||||
'description': """
|
||||
With this module, when you manually create a payment line that is not linked to a journal item, you can select an account (by default, it is set to the payable/receivable account of the partner) : this account will be used as the counter part of the outbound/inbound payment account configured on the bank journal. It covers special needs of a few companies that use SEPA credit transfer for the same partner in different accounting scenarios.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion
|
||||
<alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'maintainers': ['alexis-via'],
|
||||
'website': 'https://github.com/akretion/odoo-usability',
|
||||
'depends': ['account_payment_order'],
|
||||
'data': [
|
||||
"views/account_payment_line.xml",
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
2
account_payment_line_manual_account/models/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import account_payment_line
|
||||
from . import account_payment_order
|
||||
@@ -0,0 +1,38 @@
|
||||
# Copyright 2024 Akretion France (https://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountPaymentLine(models.Model):
|
||||
_inherit = "account.payment.line"
|
||||
|
||||
account_id = fields.Many2one(
|
||||
'account.account',
|
||||
compute="_compute_account_id", store=True, readonly=False, check_company=True,
|
||||
domain="[('company_id', '=', company_id), ('deprecated', '=', False)]")
|
||||
analytic_account_id = fields.Many2one(
|
||||
'account.analytic.account', string='Analytic Account',
|
||||
domain="[('company_id', 'in', [False, company_id])]",
|
||||
check_company=True)
|
||||
|
||||
@api.depends('move_line_id', 'partner_id')
|
||||
def _compute_account_id(self):
|
||||
for line in self:
|
||||
account_id = False
|
||||
if not line.move_line_id and line.partner_id:
|
||||
partner = line.partner_id.with_company(line.order_id.company_id.id)
|
||||
if line.order_id.payment_type == "inbound":
|
||||
account_id = partner.property_account_receivable_id.id
|
||||
else:
|
||||
account_id = partner.property_account_payable_id.id
|
||||
line.account_id = account_id
|
||||
|
||||
# take info account account_id for grouping
|
||||
def payment_line_hashcode(self):
|
||||
hashcode = super().payment_line_hashcode()
|
||||
account_str = str(self.account_id.id or False)
|
||||
analytic_account_str = str(self.analytic_account_id.id or False)
|
||||
hashcode = '-'.join([hashcode, account_str, analytic_account_str])
|
||||
return hashcode
|
||||
@@ -0,0 +1,18 @@
|
||||
# Copyright 2024 Akretion France (https://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountPaymentOrder(models.Model):
|
||||
_inherit = "account.payment.order"
|
||||
|
||||
def _prepare_move_line_partner_account(self, bank_line):
|
||||
vals = super()._prepare_move_line_partner_account(bank_line)
|
||||
if not bank_line.payment_line_ids[0].move_line_id:
|
||||
vals.update({
|
||||
'account_id': bank_line.payment_line_ids[0].account_id.id,
|
||||
'analytic_account_id': bank_line.payment_line_ids[0].analytic_account_id.id or False,
|
||||
})
|
||||
return vals
|
||||
BIN
account_payment_line_manual_account/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2024 Akretion France (https://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="account_payment_line_form" model="ir.ui.view">
|
||||
<field name="model">account.payment.line</field>
|
||||
<field name="inherit_id" ref="account_payment_order.account_payment_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="company_id" position="after">
|
||||
<field name="account_id" attrs="{'invisible': [('move_line_id', '!=', False)], 'required': [('move_line_id', '=', False)]}"/>
|
||||
<field name="analytic_account_id" attrs="{'invisible': [('move_line_id', '!=', False)]}" groups="analytic.group_analytic_accounting"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account_payment_line_tree" model="ir.ui.view">
|
||||
<field name="model">account.payment.line</field>
|
||||
<field name="inherit_id" ref="account_payment_order.account_payment_line_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="move_line_id" position="after">
|
||||
<field name="account_id" optional="hide"/>
|
||||
<field name="analytic_account_id" optional="hide" groups="analytic.group_analytic_accounting"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -2,10 +2,13 @@
|
||||
Account Usability
|
||||
=================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
..
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:0a1f18d3ec52ddde3b0ffdb507573d43a38ec1609a578fae0c43f5e5a65026be
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
@@ -14,7 +17,7 @@ Account Usability
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
|
||||
:target: https://github.com/akretion/odoo-usability/tree/12.0/account_usability
|
||||
:target: https://github.com/akretion/odoo-usability/tree/14.0/account_usability
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
@@ -52,7 +55,6 @@ This modules adds the following functions:
|
||||
* don't attach PDF upon invoice report generation on supplier invoices/refunds
|
||||
* Add filter on debit and credit amount for Move Lines
|
||||
* Add supplier invoice number in invoice tree view
|
||||
* Add date in outstanding payment widget on invoice form view (requires `odoo PR 84180 <https://github.com/odoo/odoo/pull/84180>`_)
|
||||
|
||||
Together with this module, I recommend the use of the following modules:
|
||||
|
||||
@@ -70,8 +72,8 @@ Bug Tracker
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_usability%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
@@ -92,6 +94,6 @@ Contributors
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/account_usability>`_ project on GitHub.
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/14.0/account_usability>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute.
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
'views/product.xml',
|
||||
'views/res_config_settings.xml',
|
||||
'views/res_company.xml',
|
||||
'views/res_partner.xml',
|
||||
'views/account_report.xml',
|
||||
'views/account_reconcile_model.xml',
|
||||
'wizard/account_invoice_mark_sent_view.xml',
|
||||
|
||||
@@ -43,13 +43,6 @@ class AccountBankStatement(models.Model):
|
||||
res.append((statement.id, name))
|
||||
return res
|
||||
|
||||
def button_reopen(self):
|
||||
self = self.with_context(skip_undo_reconciliation=True)
|
||||
return super().button_reopen()
|
||||
|
||||
def button_undo_reconciliation(self):
|
||||
self.line_ids.button_undo_reconciliation()
|
||||
|
||||
|
||||
class AccountBankStatementLine(models.Model):
|
||||
_inherit = 'account.bank.statement.line'
|
||||
@@ -96,9 +89,3 @@ class AccountBankStatementLine(models.Model):
|
||||
'res_id': self.move_id.id,
|
||||
})
|
||||
return action
|
||||
|
||||
def button_undo_reconciliation(self):
|
||||
if self._context.get("skip_undo_reconciliation"):
|
||||
return
|
||||
else:
|
||||
return super().button_undo_reconciliation()
|
||||
|
||||
@@ -10,6 +10,8 @@ from odoo.exceptions import UserError, ValidationError
|
||||
from odoo.osv import expression
|
||||
from odoo.tools import float_is_zero
|
||||
from odoo.tools.misc import format_date
|
||||
from odoo.tools.safe_eval import safe_eval, time
|
||||
from collections import defaultdict
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -50,6 +52,39 @@ class AccountMove(models.Model):
|
||||
string="Dispute",
|
||||
tracking=True,
|
||||
)
|
||||
# Having amounts in invoice currency can be useful in tree view of invoices
|
||||
# We add those fields with optional="hide"
|
||||
amount_untaxed_invoice_currency_signed = fields.Monetary(
|
||||
compute="_compute_amount_invoice_currency_signed", store=True,
|
||||
string="Untaxed Amount Invoice Currency Signed")
|
||||
amount_tax_invoice_currency_signed = fields.Monetary(
|
||||
compute="_compute_amount_invoice_currency_signed", store=True,
|
||||
string="Tax Invoice Currency Signed")
|
||||
amount_total_invoice_currency_signed = fields.Monetary(
|
||||
compute="_compute_amount_invoice_currency_signed", store=True,
|
||||
string="Total Invoice Currency Signed")
|
||||
amount_residual_invoice_currency_signed = fields.Monetary(
|
||||
compute="_compute_amount_invoice_currency_signed", store=True,
|
||||
string="Amount Due Invoice Currency Signed")
|
||||
# Field search_account_id is just for search view
|
||||
search_account_id = fields.Many2one(related='line_ids.account_id')
|
||||
|
||||
@api.depends('amount_untaxed', 'amount_tax', 'amount_total', 'amount_residual', 'move_type')
|
||||
def _compute_amount_invoice_currency_signed(self):
|
||||
for move in self:
|
||||
amount_untaxed_invoice_currency_signed = move.amount_untaxed
|
||||
amount_tax_invoice_currency_signed = move.amount_tax
|
||||
amount_total_invoice_currency_signed = move.amount_total
|
||||
amount_residual_invoice_currency_signed = move.amount_residual
|
||||
if move.move_type in ('out_refund', 'in_refund'):
|
||||
amount_untaxed_invoice_currency_signed *= -1
|
||||
amount_tax_invoice_currency_signed *= -1
|
||||
amount_total_invoice_currency_signed *= -1
|
||||
amount_residual_invoice_currency_signed *= -1
|
||||
move.amount_untaxed_invoice_currency_signed = amount_untaxed_invoice_currency_signed
|
||||
move.amount_tax_invoice_currency_signed = amount_tax_invoice_currency_signed
|
||||
move.amount_total_invoice_currency_signed = amount_total_invoice_currency_signed
|
||||
move.amount_residual_invoice_currency_signed = amount_residual_invoice_currency_signed
|
||||
|
||||
@api.depends("line_ids", "line_ids.blocked")
|
||||
def _compute_blocked(self):
|
||||
@@ -223,33 +258,14 @@ class AccountMove(models.Model):
|
||||
move.suitable_journal_ids = self.env['account.journal'].search(domain)
|
||||
|
||||
def button_draft(self):
|
||||
super().button_draft()
|
||||
# Delete attached pdf invoice
|
||||
try:
|
||||
report_invoice = self.env['ir.actions.report']._get_report_from_name('account.report_invoice')
|
||||
except IndexError:
|
||||
report_invoice = False
|
||||
if report_invoice and report_invoice.attachment:
|
||||
for move in self.filtered(lambda x: x.move_type in ('out_invoice', 'out_refund')):
|
||||
# The pb is that the filename is dynamic and related to move.state
|
||||
# in v12, the feature was native and they used that kind of code:
|
||||
# with invoice.env.do_in_draft():
|
||||
# invoice.number, invoice.state = invoice.move_name, 'open'
|
||||
# attachment = self.env.ref('account.account_invoices').retrieve_attachment(invoice)
|
||||
# But do_in_draft() doesn't exists in v14
|
||||
# If you know how we could do that, please update the code below
|
||||
attachment = self.env['ir.attachment'].search([
|
||||
('name', '=', self._get_invoice_attachment_name()),
|
||||
('res_id', '=', move.id),
|
||||
('res_model', '=', self._name),
|
||||
('type', '=', 'binary'),
|
||||
], limit=1)
|
||||
if attachment:
|
||||
attachment.unlink()
|
||||
|
||||
def _get_invoice_attachment_name(self):
|
||||
self.ensure_one()
|
||||
return '%s.pdf' % (self.name and self.name.replace('/', '_') or 'INV')
|
||||
for report_xmlid in ('account.account_invoices', 'account.account_invoices_without_payment'):
|
||||
report = self.env.ref(report_xmlid)
|
||||
attach = report.retrieve_attachment(move)
|
||||
if attach:
|
||||
attach.unlink()
|
||||
super().button_draft()
|
||||
|
||||
def _get_accounting_date(self, invoice_date, has_tax):
|
||||
# On vendor bills/refunds, we want date = invoice_date unless
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||
<title>Account Usability</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
Despite the name, some widely supported CSS2 features are used.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code .ln { color: gray; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
@@ -301,7 +301,7 @@ span.option {
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
span.problematic, pre.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
@@ -366,8 +366,10 @@ ul.auto-toc {
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:0a1f18d3ec52ddde3b0ffdb507573d43a38ec1609a578fae0c43f5e5a65026be
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/account_usability"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/akretion/odoo-usability/tree/14.0/account_usability"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p>This modules adds the following functions:</p>
|
||||
<ul class="simple">
|
||||
<li>Add an <em>Overdue</em> filter on invoice search view (this feature was previously
|
||||
@@ -411,41 +413,41 @@ located in te module <em>account_invoice_overdue_filter</em>)</li>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_usability%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Akretion</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Alexis de Lattre <<a class="reference external" href="mailto:alexis.delattre@akretion.com">alexis.delattre@akretion.com</a>></li>
|
||||
<li>David Beal <<a class="reference external" href="mailto:david.beal@akretion.com">david.beal@akretion.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/account_usability">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/14.0/account_usability">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,12 +7,24 @@
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_account_type_form" model="ir.ui.view">
|
||||
<field name="name">account_usability.account_account_type.form</field>
|
||||
<field name="model">account.account.type</field>
|
||||
<field name="inherit_id" ref="account.view_account_type_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="type" position="after">
|
||||
<field name="internal_group"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_type_tree" model="ir.ui.view">
|
||||
<field name="name">account_usability.account_type_tree</field>
|
||||
<field name="name">account_usability.account_account_type_tree</field>
|
||||
<field name="model">account.account.type</field>
|
||||
<field name="inherit_id" ref="account.view_account_type_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="type" position="after">
|
||||
<field name="internal_group" optional="show"/>
|
||||
<field name="include_initial_balance" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -16,14 +16,6 @@
|
||||
<button name="button_reopen" position="attributes">
|
||||
<attribute name="confirm">Are you sure ? Don't do 'Reset to New' if you just want to modify the bank journal entry of an existing statement line.</attribute>
|
||||
</button>
|
||||
<button name="button_reopen" position="after">
|
||||
<button
|
||||
name="button_undo_reconciliation"
|
||||
type="object"
|
||||
confirm="Are you sure to unreconcile all the entries of the bank statement?"
|
||||
states="open"
|
||||
string="Unreconcile All"/>
|
||||
</button>
|
||||
<xpath expr="//field[@name='line_ids']/tree/button[@name='button_undo_reconciliation']" position="after">
|
||||
<field name="move_id" invisible="1"/>
|
||||
<button name="show_account_move" type="object"
|
||||
|
||||
@@ -67,6 +67,14 @@
|
||||
<field name="amount_residual_signed" position="attributes">
|
||||
<attribute name="optional">show</attribute>
|
||||
</field>
|
||||
<field name="amount_untaxed_signed" position="before">
|
||||
<!-- No sum="1" on the invoice currency fields, because it doesn't make sense
|
||||
to add amounts in different currencies -->
|
||||
<field name="amount_untaxed_invoice_currency_signed" string="Tax Excluded Inv. Cur." optional="hide"/>
|
||||
<field name="amount_tax_invoice_currency_signed" string="Tax Inv. Cur." optional="hide"/>
|
||||
<field name="amount_total_invoice_currency_signed" string="Total Inv. Cur." optional="hide"/>
|
||||
<field name="amount_residual_invoice_currency_signed" string="Amount Due Inv. Cur." optional="hide"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -93,6 +101,16 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_move_filter" model="ir.ui.view">
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_account_move_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="journal_id" position="after">
|
||||
<field name="search_account_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_move_line_form" model="ir.ui.view">
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_form"/>
|
||||
|
||||
21
account_usability/views/res_partner.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2024 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_partner_property_form" model="ir.ui.view">
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="account.view_partner_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='bank_ids']/tree/field[@name='acc_holder_name']" position="attributes">
|
||||
<attribute name="invisible">0</attribute>
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -2,10 +2,13 @@
|
||||
Base Company Extension
|
||||
======================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
..
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:f1f2fb39af0682210c6ac91e106869ab7bfffe1c397becc289eaaf68b707e933
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
@@ -14,24 +17,28 @@ Base Company Extension
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
|
||||
:target: https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension
|
||||
:target: https://github.com/akretion/odoo-usability/tree/14.0/base_company_extension
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
|
||||
This module adds the following fields on the company:
|
||||
|
||||
This module adds the following fields to the ResCompany model:
|
||||
* Capital Amount
|
||||
* Legal Type
|
||||
|
||||
This is useful to display the legal name of the company in reports.
|
||||
This is useful to display the legal name of the company in reports
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_company_extension%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
@@ -52,6 +59,6 @@ Contributors
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension>`_ project on GitHub.
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/14.0/base_company_extension>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute.
|
||||
|
||||
BIN
base_company_extension/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||
<title>Base Company Extension</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
Despite the name, some widely supported CSS2 features are used.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code .ln { color: gray; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
@@ -301,7 +301,7 @@ span.option {
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
span.problematic, pre.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
@@ -366,8 +366,10 @@ ul.auto-toc {
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:f1f2fb39af0682210c6ac91e106869ab7bfffe1c397becc289eaaf68b707e933
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/akretion/odoo-usability/tree/14.0/base_company_extension"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p>This module adds the following fields to the ResCompany model:
|
||||
* Capital Amount
|
||||
* Legal Type</p>
|
||||
@@ -375,40 +377,40 @@ ul.auto-toc {
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_company_extension%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_company_extension%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Akretion</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Alexis de Lattre <<a class="reference external" href="mailto:alexis.delattre@akretion.com">alexis.delattre@akretion.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/14.0/base_company_extension">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
BIN
base_dynamic_list/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
base_mail_sender_bcc/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
base_partner_one2many_phone/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
base_partner_ref/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
@@ -2,10 +2,13 @@
|
||||
Base Usability
|
||||
==============
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
..
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:34b38099c08b1967a5082dd802765b1b34015403159badf256ee845648d9e6da
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
@@ -14,7 +17,7 @@ Base Usability
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
|
||||
:target: https://github.com/akretion/odoo-usability/tree/12.0/base_usability
|
||||
:target: https://github.com/akretion/odoo-usability/tree/14.0/base_usability
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
@@ -55,8 +58,8 @@ Bug Tracker
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_usability%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
@@ -72,11 +75,12 @@ Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Raphaël Valyi <rvalyi@akretion.com>
|
||||
* David Beal <david.beal@akretion.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/base_usability>`_ project on GitHub.
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/14.0/base_usability>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute.
|
||||
|
||||
13
base_usability/fix-mimetypes_application_xml.diff
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/odoo/tools/mimetypes.py b/odoo/tools/mimetypes.py
|
||||
index d104198a4ae..6eeabcc63a3 100644
|
||||
--- a/odoo/tools/mimetypes.py
|
||||
+++ b/odoo/tools/mimetypes.py
|
||||
@@ -123,7 +123,7 @@ _mime_mappings = (
|
||||
_Entry('image/png', [b'\x89PNG\r\n\x1A\n'], []),
|
||||
_Entry('image/gif', [b'GIF87a', b'GIF89a'], []),
|
||||
_Entry('image/bmp', [b'BM'], []),
|
||||
- _Entry('image/svg+xml', [b'<'], [
|
||||
+ _Entry('application/xml', [b'<'], [
|
||||
_check_svg,
|
||||
]),
|
||||
_Entry('image/x-icon', [b'\x00\x00\x01\x00'], []),
|
||||
@@ -6,8 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-07-01 10:02+0000\n"
|
||||
"PO-Revision-Date: 2021-07-01 10:02+0000\n"
|
||||
"POT-Creation-Date: 2024-03-26 21:27+0000\n"
|
||||
"PO-Revision-Date: 2024-03-26 21:27+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -15,6 +15,18 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#, python-format
|
||||
msgid "%s with a capital of"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#, python-format
|
||||
msgid "APE:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_partner_bank
|
||||
msgid "Bank Accounts"
|
||||
@@ -25,11 +37,22 @@ msgstr ""
|
||||
msgid "Bank Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#, python-format
|
||||
msgid "Capital:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_company
|
||||
msgid "Companies"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.ir_property_view_search
|
||||
msgid "Company"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_partner
|
||||
msgid "Contact"
|
||||
@@ -48,6 +71,7 @@ msgid "Customer Number:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_actions_report__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_mail_server__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_model__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_company__display_name
|
||||
@@ -65,12 +89,24 @@ msgstr ""
|
||||
msgid "E-mail:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#, python-format
|
||||
msgid "EORI:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.ir_property_view_search
|
||||
msgid "Field"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.res_country_search
|
||||
msgid "Group By"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_actions_report__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_mail_server__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_model__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_company__id
|
||||
@@ -87,6 +123,7 @@ msgid "Installable"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_actions_report____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_mail_server____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_model____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_company____last_update
|
||||
@@ -139,6 +176,11 @@ msgstr ""
|
||||
msgid "Partner Tags"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_actions_report__print_report_name
|
||||
msgid "Printed Report Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner__ref
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_users__ref
|
||||
@@ -146,8 +188,14 @@ msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.res_country_search
|
||||
msgid "Search Countries"
|
||||
#: model:ir.model,name:base_usability.model_ir_actions_report
|
||||
msgid "Report Action"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#, python-format
|
||||
msgid "SIRET:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
@@ -169,6 +217,14 @@ msgstr ""
|
||||
msgid "Tel:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,help:base_usability.field_ir_actions_report__print_report_name
|
||||
msgid ""
|
||||
"This is the filename of the report going to download. Keep empty to not "
|
||||
"change the report filename. You can use a python expression with the "
|
||||
"'object' and 'time' variables."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_users
|
||||
msgid "Users"
|
||||
|
||||
@@ -6,15 +6,27 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-07-01 10:02+0000\n"
|
||||
"PO-Revision-Date: 2021-07-01 12:15+0200\n"
|
||||
"Last-Translator: Alexis de Lattre <alexis@via.ecp.fr>\n"
|
||||
"POT-Creation-Date: 2024-03-26 21:27+0000\n"
|
||||
"PO-Revision-Date: 2024-03-26 21:27+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#, python-format
|
||||
msgid "%s with a capital of"
|
||||
msgstr "%s au capital de"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#, python-format
|
||||
msgid "APE:"
|
||||
msgstr "APE :"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_partner_bank
|
||||
msgid "Bank Accounts"
|
||||
@@ -25,11 +37,22 @@ msgstr "Comptes bancaires"
|
||||
msgid "Bank Name"
|
||||
msgstr "Nom de la banque"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#, python-format
|
||||
msgid "Capital:"
|
||||
msgstr "Capital : "
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_company
|
||||
msgid "Companies"
|
||||
msgstr "Sociétés"
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.ir_property_view_search
|
||||
msgid "Company"
|
||||
msgstr "Société"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_partner
|
||||
msgid "Contact"
|
||||
@@ -42,11 +65,13 @@ msgstr "Devise"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "Customer Number:"
|
||||
msgstr "N° client :"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_actions_report__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_mail_server__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_model__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_company__display_name
|
||||
@@ -64,12 +89,24 @@ msgstr "Nom affiché"
|
||||
msgid "E-mail:"
|
||||
msgstr "E-mail :"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#, python-format
|
||||
msgid "EORI:"
|
||||
msgstr "EORI :"
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.ir_property_view_search
|
||||
msgid "Field"
|
||||
msgstr "Champ"
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.res_country_search
|
||||
msgid "Group By"
|
||||
msgstr "Grouper par"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_actions_report__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_mail_server__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_model__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_company__id
|
||||
@@ -78,7 +115,7 @@ msgstr "Grouper par"
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_category__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_users__id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.view_module_filter
|
||||
@@ -86,6 +123,7 @@ msgid "Installable"
|
||||
msgstr "Installable"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_actions_report____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_mail_server____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_model____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_company____last_update
|
||||
@@ -136,7 +174,12 @@ msgstr "Personne (utilisé pour cacher des entrées de menu natifs)"
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_partner_category
|
||||
msgid "Partner Tags"
|
||||
msgstr "Étiquettes du partenaire"
|
||||
msgstr "Étiquettes contact"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_actions_report__print_report_name
|
||||
msgid "Printed Report Name"
|
||||
msgstr "Nom du rapport imprimé"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner__ref
|
||||
@@ -145,11 +188,18 @@ msgid "Reference"
|
||||
msgstr "Référence"
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.res_country_search
|
||||
msgid "Search Countries"
|
||||
#: model:ir.model,name:base_usability.model_ir_actions_report
|
||||
msgid "Report Action"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#, python-format
|
||||
msgid "SIRET:"
|
||||
msgstr "SIRET :"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "Supplier Number:"
|
||||
@@ -158,7 +208,7 @@ msgstr "N° fournisseur :"
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_category__name
|
||||
msgid "Tag Name"
|
||||
msgstr "Nom de l'étiquette"
|
||||
msgstr "Libellé de l'étiquette"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
@@ -167,6 +217,14 @@ msgstr "Nom de l'étiquette"
|
||||
msgid "Tel:"
|
||||
msgstr "Tél :"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,help:base_usability.field_ir_actions_report__print_report_name
|
||||
msgid ""
|
||||
"This is the filename of the report going to download. Keep empty to not "
|
||||
"change the report filename. You can use a python expression with the "
|
||||
"'object' and 'time' variables."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_users
|
||||
msgid "Users"
|
||||
|
||||
@@ -6,3 +6,4 @@ from . import res_company
|
||||
from . import ir_mail_server
|
||||
from . import ir_actions_report
|
||||
from . import ir_model
|
||||
from . import misc
|
||||
|
||||
39
base_usability/models/misc.py
Normal file
@@ -0,0 +1,39 @@
|
||||
# Copyright 2025 Akretion France (https://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, api
|
||||
from odoo.tools import misc
|
||||
from openerp.tools import float_compare
|
||||
|
||||
|
||||
class BaseUsabilityInstalled(models.AbstractModel):
|
||||
_name = "base.usability.installed"
|
||||
_description = "Base Usability Installed"
|
||||
|
||||
|
||||
formatLang_original = misc.formatLang
|
||||
|
||||
|
||||
def formatLang(
|
||||
self, value, digits=None, grouping=True,
|
||||
monetary=False, dp=False, currency_obj=False, int_no_digits=True):
|
||||
with api.Environment.manage():
|
||||
env = api.Environment(self.cr, self.uid, {})
|
||||
if (
|
||||
'base.usability.installed' in env and
|
||||
int_no_digits and
|
||||
not monetary and
|
||||
isinstance(value, float) and
|
||||
dp):
|
||||
prec = env['decimal.precision'].precision_get(dp)
|
||||
if not float_compare(value, int(value), precision_digits=prec):
|
||||
digits = 0
|
||||
dp = False
|
||||
res = formatLang_original(
|
||||
self, value, digits=digits, grouping=grouping,
|
||||
monetary=monetary, dp=dp, currency_obj=currency_obj)
|
||||
return res
|
||||
|
||||
|
||||
misc.formatLang = formatLang
|
||||
@@ -3,6 +3,7 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, models, _
|
||||
from odoo.tools.misc import format_amount
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
@@ -39,32 +40,82 @@ class ResCompany(models.Model):
|
||||
'value': self.phone,
|
||||
# http://www.fileformat.info/info/unicode/char/1f4de/index.htm
|
||||
'icon': '\U0001F4DE',
|
||||
'label': _('Tel:')},
|
||||
'label': _('Tel:'),
|
||||
},
|
||||
'email': {
|
||||
'value': self.email,
|
||||
# http://www.fileformat.info/info/unicode/char/2709/index.htm
|
||||
'icon': '\u2709',
|
||||
'label': _('E-mail:')},
|
||||
'label': _('E-mail:'),
|
||||
},
|
||||
'website': {
|
||||
'value': self.website,
|
||||
'icon': '\U0001f310',
|
||||
'label': _('Website:')},
|
||||
'label': _('Website:'),
|
||||
},
|
||||
'vat': {
|
||||
'value': self.vat,
|
||||
'label': _('VAT:')},
|
||||
'label': _('VAT:'),
|
||||
},
|
||||
'ape': {
|
||||
'value': hasattr(self, 'ape') and self.ape or False,
|
||||
'label': _('APE:'),
|
||||
},
|
||||
'siret': {
|
||||
'value': hasattr(self, 'siret') and self.siret or False,
|
||||
'label': _('SIRET:'),
|
||||
},
|
||||
'siren': {
|
||||
'value': hasattr(self, 'siren') and self.siren or False,
|
||||
'label': _('SIREN:'),
|
||||
},
|
||||
'rcs_siren': {
|
||||
'value': hasattr(self, 'siren') and self.siren and self.company_registry and f"{self.company_registry} {self.siren}",
|
||||
'label': 'RCS',
|
||||
},
|
||||
'eori': {
|
||||
'value': self._get_eori(),
|
||||
'label': _('EORI:'),
|
||||
},
|
||||
'capital': {
|
||||
# 'capital_amount' added by base_company_extension
|
||||
'value': hasattr(self, 'capital_amount') and self.capital_amount and format_amount(self.env, self.capital_amount, self.currency_id) or False,
|
||||
'label': _('Capital:'),
|
||||
}
|
||||
}
|
||||
# 'legal_type' added by base_company_extension
|
||||
if hasattr(self, 'legal_type') and self.legal_type:
|
||||
options['capital']['label'] = _('%s with a capital of') % self.legal_type
|
||||
return options
|
||||
|
||||
def _get_eori(self):
|
||||
eori = False
|
||||
if self.partner_id.country_id.code == 'FR' and hasattr(self, 'siret') and self.siret:
|
||||
# Currently migrating from EORI-SIRET to EORI-SIREN :
|
||||
# https://www.pwcavocats.com/fr/ealertes/ealertes-france/2023/avril/reforme-numero-eori-siren-siret.html
|
||||
# But, for the moment, we continue to use EORI-SIRET
|
||||
eori = f'FR{self.siret}'
|
||||
return eori
|
||||
|
||||
def _report_company_legal_name(self):
|
||||
'''Method inherited in the module base_company_extension'''
|
||||
self.ensure_one()
|
||||
return self.name
|
||||
|
||||
def _report_header_line_details(self):
|
||||
"""This method is designed to be inherited"""
|
||||
# I decided not to put email in the default header because only a few very small
|
||||
# companies have a generic company email address
|
||||
line_details = [['phone', 'website', 'rcs_siren', 'capital'], ['vat', 'siret', 'eori', 'ape']]
|
||||
return line_details
|
||||
|
||||
# for reports
|
||||
def _display_report_header(
|
||||
self, line_details=[['phone', 'website'], ['vat']],
|
||||
icon=True, line_separator=' - '):
|
||||
self, line_details=None, icon=True, line_separator=' - '):
|
||||
self.ensure_one()
|
||||
if line_details is None:
|
||||
line_details = self._report_header_line_details()
|
||||
|
||||
res = ''
|
||||
address = self.partner_id._display_address(without_company=True)
|
||||
address = address.replace('\n', ' - ')
|
||||
|
||||
@@ -125,6 +125,20 @@ class ResPartner(models.Model):
|
||||
'label': _('Supplier Number:'),
|
||||
},
|
||||
}
|
||||
if hasattr(self, 'siren'):
|
||||
options['siren'] = {
|
||||
'value': self.siren,
|
||||
'label': _("SIREN:"),
|
||||
}
|
||||
if hasattr(self, 'siret'):
|
||||
if hasattr(self, 'siren'): # l10n_fr_siret is installed
|
||||
siret = self.siren and self.nic and self.siret or False
|
||||
else:
|
||||
siret = self.siret
|
||||
options['siret'] = {
|
||||
'value': siret,
|
||||
'label': _("SIRET:"),
|
||||
}
|
||||
res = []
|
||||
for detail in details:
|
||||
if options.get(detail) and options[detail]['value']:
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||
<title>Base Usability</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
Despite the name, some widely supported CSS2 features are used.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code .ln { color: gray; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
@@ -301,7 +301,7 @@ span.option {
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
span.problematic, pre.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
@@ -366,8 +366,10 @@ ul.auto-toc {
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:34b38099c08b1967a5082dd802765b1b34015403159badf256ee845648d9e6da
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/base_usability"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/akretion/odoo-usability/tree/14.0/base_usability"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p>This module adds the following functions:</p>
|
||||
<ul class="simple">
|
||||
<li>Adds <em>track_visibility=’onchange’</em> on all the important fields of the Partner object</li>
|
||||
@@ -397,41 +399,42 @@ ul.auto-toc {
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_usability%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Akretion</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
|
||||
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Alexis de Lattre <<a class="reference external" href="mailto:alexis.delattre@akretion.com">alexis.delattre@akretion.com</a>></li>
|
||||
<li>Raphaël Valyi <<a class="reference external" href="mailto:rvalyi@akretion.com">rvalyi@akretion.com</a>></li>
|
||||
<li>David Beal <<a class="reference external" href="mailto:david.beal@akretion.com">david.beal@akretion.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/base_usability">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/14.0/base_usability">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,6 +27,17 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="res_partner_view_form_private" model="ir.ui.view">
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.res_partner_view_form_private"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='bank_ids']/tree/field[@name='acc_holder_name']" position="attributes">
|
||||
<attribute name="invisible">0</attribute>
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_partner_simple_form" model="ir.ui.view">
|
||||
<field name="name">base_usability.title.on.partner.simplified.form</field>
|
||||
<field name="model">res.partner</field>
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
<field name="bank_name" position="after">
|
||||
<field name="bank_id"/>
|
||||
</field>
|
||||
<field name="acc_holder_name" position="attributes">
|
||||
<attribute name="invisible">0</attribute>
|
||||
<attribute name="optional">hide</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
16
base_usability/web-buttons_14_max_instead_of_7.diff
Normal file
@@ -0,0 +1,16 @@
|
||||
diff --git a/addons/web/static/src/js/views/form/form_renderer.js b/addons/web/static/src/js/views/form/form_renderer.js
|
||||
index e4c1b187169..ccd8110478f 100644
|
||||
--- a/addons/web/static/src/js/views/form/form_renderer.js
|
||||
+++ b/addons/web/static/src/js/views/form/form_renderer.js
|
||||
@@ -516,7 +516,10 @@ var FormRenderer = BasicRenderer.extend({
|
||||
* @returns {integer}
|
||||
*/
|
||||
_renderButtonBoxNbButtons: function () {
|
||||
- return [2, 2, 2, 4][config.device.size_class] || 7;
|
||||
+ /* AKRETION HACK 24/04/2024
|
||||
+ * show 14 buttons before adding 'More' dropdown list (instead of 7 by default
|
||||
+ */
|
||||
+ return [2, 2, 2, 4][config.device.size_class] || 14;
|
||||
},
|
||||
/**
|
||||
* Do not render a field widget if it is always invisible.
|
||||
2
commission_simple/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import models
|
||||
from . import wizards
|
||||
46
commission_simple/__manifest__.py
Normal file
@@ -0,0 +1,46 @@
|
||||
# Copyright 2019-2025 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Commission Simple',
|
||||
'version': '14.0.1.0.0',
|
||||
'category': 'Sales',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Compute commissions for salesman',
|
||||
'description': """
|
||||
Commission Simple
|
||||
=================
|
||||
|
||||
This module is a **simple** module to compute commission for salesman. From my experience, companies often use very specific methods to compute commissions and it's impossible to develop a module that can support all of them. So the goal of this module is just to have a simple base to build the company-specific commissionning system by inheriting this simple module.
|
||||
|
||||
Here is a short description of this module:
|
||||
|
||||
* create commission profiles using rules (per product category, per product, per product and customer, etc.),
|
||||
* the commission rules can have a start and end date (optional),
|
||||
* commissionning can happen on invoicing or on payment,
|
||||
* each invoice line can only be commissionned to one salesman,
|
||||
* commission reports are stored in Odoo.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion
|
||||
<alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'https://github.com/akretion/odoo-usability',
|
||||
'depends': [
|
||||
'account',
|
||||
'date_range',
|
||||
],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'security/rule.xml',
|
||||
'data/decimal_precision.xml',
|
||||
'views/commission_profile.xml',
|
||||
'views/commission_rule.xml',
|
||||
'views/commission_result.xml',
|
||||
'views/account_move_line.xml',
|
||||
'views/res_config_settings.xml',
|
||||
'wizards/commission_compute_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
11
commission_simple/data/decimal_precision.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo noupdate="1">
|
||||
|
||||
|
||||
<record forcecreate="True" id="commission_rate" model="decimal.precision">
|
||||
<field name="name">Commission Rate</field>
|
||||
<field name="digits">2</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
640
commission_simple/i18n/fr.po
Normal file
@@ -0,0 +1,640 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * commission_simple
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-11-29 23:38+0000\n"
|
||||
"PO-Revision-Date: 2024-11-29 23:38+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.constraint,message:commission_simple.constraint_commission_result_salesman_period_company_unique
|
||||
msgid ""
|
||||
"A commission result already exists for this salesman/agent for the same "
|
||||
"period."
|
||||
msgstr ""
|
||||
"Un état des commissions existe déjà pour ce vendeur/agent pour la même "
|
||||
"période."
|
||||
|
||||
#. module: commission_simple
|
||||
#. odoo-python
|
||||
#: code:addons/commission_simple/models/commission_profile.py:0
|
||||
#, python-format
|
||||
msgid "A salesman must be selected when the assignment type is 'Salesman'."
|
||||
msgstr ""
|
||||
"Un vendeur doit être sélectionné lorsque le type d'affectation est "
|
||||
"\"Vendeur\"."
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_needaction
|
||||
msgid "Action Needed"
|
||||
msgstr "Action requise"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__active
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__active
|
||||
msgid "Active"
|
||||
msgstr "Actif"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_ids
|
||||
msgid "Activities"
|
||||
msgstr "Activités"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_exception_decoration
|
||||
msgid "Activity Exception Decoration"
|
||||
msgstr "Style d'affichage de l'activité-alerte"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_state
|
||||
msgid "Activity State"
|
||||
msgstr "État de l'activité"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_type_icon
|
||||
msgid "Activity Type Icon"
|
||||
msgstr "Îcone du type d'activité"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__applied_on
|
||||
msgid "Apply On"
|
||||
msgstr "Conditions"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_profile_form
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_rule_search
|
||||
msgid "Archived"
|
||||
msgstr "Archivé"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
|
||||
msgid "Are you sure you want to go back to draft?"
|
||||
msgstr "Êtes-vous sûr de vouloir revenir à l'état brouillon ?"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__assign_type
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_search
|
||||
msgid "Assign Type"
|
||||
msgstr "Type d'affectation"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__assign_ids
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_profile_form
|
||||
msgid "Assignments"
|
||||
msgstr "Assignations"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_attachment_count
|
||||
msgid "Attachment Count"
|
||||
msgstr "Nombre de pièces jointes"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
|
||||
msgid "Back to Draft"
|
||||
msgstr "Remettre en brouillon"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_compute_form
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__commission_amount
|
||||
msgid "Commission Amount"
|
||||
msgstr "Montant de la commission"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__commission_base
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__base
|
||||
msgid "Commission Base"
|
||||
msgstr "Base de la commission"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__line_ids
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
|
||||
msgid "Commission Lines"
|
||||
msgstr "Lignes commission"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__date_range_type_id
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_res_company__commission_date_range_type_id
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_res_config_settings__commission_date_range_type_id
|
||||
msgid "Commission Periodicity"
|
||||
msgstr "Périodicité de commission"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model,name:commission_simple.model_commission_profile
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__profile_id
|
||||
msgid "Commission Profile"
|
||||
msgstr "Profil de commission"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model,name:commission_simple.model_commission_profile_assignment
|
||||
msgid "Commission Profile Assignment"
|
||||
msgstr "Affectation du profil de commission"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.actions.act_window,name:commission_simple.commission_profile_action
|
||||
#: model:ir.ui.menu,name:commission_simple.commission_profile_menu
|
||||
msgid "Commission Profiles"
|
||||
msgstr "Profils de commission"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__commission_rate
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__rate
|
||||
msgid "Commission Rate"
|
||||
msgstr "Taux de commission"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model,name:commission_simple.model_commission_result
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__commission_result_id
|
||||
msgid "Commission Result"
|
||||
msgstr "État des commissions"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model,name:commission_simple.model_commission_rule
|
||||
msgid "Commission Rule"
|
||||
msgstr "Règle de commission"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.actions.act_window,name:commission_simple.commission_rule_action
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__rule_ids
|
||||
#: model:ir.ui.menu,name:commission_simple.commission_rule_menu
|
||||
msgid "Commission Rules"
|
||||
msgstr "Règles de commission"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__amount_total
|
||||
msgid "Commission Total"
|
||||
msgstr "Total des commissions"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.actions.act_window,name:commission_simple.commission_result_action
|
||||
#: model:ir.ui.menu,name:commission_simple.commission_config_root
|
||||
#: model:ir.ui.menu,name:commission_simple.commission_result_menu
|
||||
#: model:ir.ui.menu,name:commission_simple.commission_root
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.res_config_settings_view_form
|
||||
msgid "Commissions"
|
||||
msgstr ""
|
||||
|
||||
#. module: commission_simple
|
||||
#. odoo-python
|
||||
#: code:addons/commission_simple/wizards/commission_compute.py:0
|
||||
#, python-format
|
||||
msgid "Commissions already exist for %(period)s in company %(company)s."
|
||||
msgstr ""
|
||||
"Des commissions existent déjà pour %(period)s dans la société %(company)s."
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model,name:commission_simple.model_res_company
|
||||
msgid "Companies"
|
||||
msgstr "Sociétés"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__company_id
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__company_id
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__company_id
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__company_id
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__company_id
|
||||
msgid "Company"
|
||||
msgstr "Société"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__company_currency_id
|
||||
msgid "Company Currency"
|
||||
msgstr "Devise de la société"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_compute_form
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_rule_form
|
||||
msgid "Compute"
|
||||
msgstr "Calculer"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.actions.act_window,name:commission_simple.commission_compute_action
|
||||
#: model:ir.model,name:commission_simple.model_commission_compute
|
||||
#: model:ir.ui.menu,name:commission_simple.commission_compute_menu
|
||||
msgid "Compute Commissions"
|
||||
msgstr "Calculer les commissions"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model,name:commission_simple.model_res_config_settings
|
||||
msgid "Config Settings"
|
||||
msgstr "Configuration"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
|
||||
msgid "Confirm"
|
||||
msgstr "Confirmer"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__create_uid
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__create_uid
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__create_uid
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__create_uid
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Créé par"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__create_date
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__create_date
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__create_date
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__create_date
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Créé le"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__partner_ids
|
||||
msgid "Customers"
|
||||
msgstr "Clients"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__display_name
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__display_name
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__display_name
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__display_name
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nom affiché"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_result__state__done
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_search
|
||||
msgid "Done"
|
||||
msgstr "Validé"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_result__state__draft
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_search
|
||||
msgid "Draft"
|
||||
msgstr "Brouillon"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__date_end
|
||||
msgid "End Date"
|
||||
msgstr "Date de fin"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__date_end
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__date_end
|
||||
msgid "End date"
|
||||
msgstr "Date de fin"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_follower_ids
|
||||
msgid "Followers"
|
||||
msgstr "Abonnés"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_partner_ids
|
||||
msgid "Followers (Partners)"
|
||||
msgstr "Abonnés (partenaires)"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,help:commission_simple.field_commission_result__activity_type_icon
|
||||
msgid "Font awesome icon e.g. fa-tasks"
|
||||
msgstr "Îcone font-awesome, par exemple fa-task"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__applied_on__4_global
|
||||
msgid "Global"
|
||||
msgstr ""
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__has_message
|
||||
msgid "Has Message"
|
||||
msgstr "A un message"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__id
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__id
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__id
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__id
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_exception_icon
|
||||
msgid "Icon"
|
||||
msgstr "Îcone"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,help:commission_simple.field_commission_result__activity_exception_icon
|
||||
msgid "Icon to indicate an exception activity."
|
||||
msgstr "Îcone pour indiquer une activité-alerte"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,help:commission_simple.field_commission_result__message_needaction
|
||||
msgid "If checked, new messages require your attention."
|
||||
msgstr "Si activé, de nouveaux messages nécessitent votre attention."
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,help:commission_simple.field_commission_result__message_has_error
|
||||
msgid "If checked, some messages have a delivery error."
|
||||
msgstr "Si activé, des messages ont une erreur d'envoi."
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_profile__trigger_type__in_payment
|
||||
msgid "In Payment and Paid"
|
||||
msgstr "En paiement et payé"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_profile__trigger_type__invoice
|
||||
msgid "Invoiced"
|
||||
msgstr "Facturé"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__base__invoiced
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
|
||||
msgid "Invoiced Amount"
|
||||
msgstr "Montant facturé"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_is_follower
|
||||
msgid "Is Follower"
|
||||
msgstr "Est abonné"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model,name:commission_simple.model_account_move_line
|
||||
msgid "Journal Item"
|
||||
msgstr "Écriture comptable"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute____last_update
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile____last_update
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment____last_update
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result____last_update
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Dernière modification le"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__write_uid
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__write_uid
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__write_uid
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__write_uid
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Dernière mise à jour par"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__write_date
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__write_date
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__write_date
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__write_date
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Dernière mise à jour le"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_main_attachment_id
|
||||
msgid "Main Attachment"
|
||||
msgstr "Pièce jointe principale"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__base__margin
|
||||
msgid "Margin"
|
||||
msgstr "Marge"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_rule_form
|
||||
msgid "Match"
|
||||
msgstr ""
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__commission_rule_id
|
||||
msgid "Matched Commission Rule"
|
||||
msgstr "Règle de commission associée"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_has_error
|
||||
msgid "Message Delivery error"
|
||||
msgstr "Erreur d'envoi du message"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_ids
|
||||
msgid "Messages"
|
||||
msgstr ""
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__my_activity_date_deadline
|
||||
msgid "My Activity Deadline"
|
||||
msgstr "Date butoir de l'activité"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__name
|
||||
msgid "Name of the Profile"
|
||||
msgstr "Nom du profil"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_calendar_event_id
|
||||
msgid "Next Activity Calendar Event"
|
||||
msgstr "Prochaine activité du calendrier"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_date_deadline
|
||||
msgid "Next Activity Deadline"
|
||||
msgstr "Date butoir de l'activité suivante"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_summary
|
||||
msgid "Next Activity Summary"
|
||||
msgstr "Résumé de l'activité suivante"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_type_id
|
||||
msgid "Next Activity Type"
|
||||
msgstr "Type de l'activité suivante"
|
||||
|
||||
#. module: commission_simple
|
||||
#. odoo-python
|
||||
#: code:addons/commission_simple/wizards/commission_compute.py:0
|
||||
#, python-format
|
||||
msgid "No commissions generated."
|
||||
msgstr "Aucune commission n'a été générée."
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_needaction_counter
|
||||
msgid "Number of Actions"
|
||||
msgstr "Nombre d'actions"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__message_has_error_counter
|
||||
msgid "Number of errors"
|
||||
msgstr "Nombre d'erreurs"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,help:commission_simple.field_commission_result__message_needaction_counter
|
||||
msgid "Number of messages requiring action"
|
||||
msgstr "Nombre de messages nécessitant une action"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,help:commission_simple.field_commission_result__message_has_error_counter
|
||||
msgid "Number of messages with delivery error"
|
||||
msgstr "Nombre de messages en échec d'envoi"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_profile__trigger_type__paid
|
||||
msgid "Paid"
|
||||
msgstr "Payé"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__date_range_id
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__date_range_id
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_search
|
||||
msgid "Period"
|
||||
msgstr "Période"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__product_categ_ids
|
||||
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__applied_on__3_product_category
|
||||
msgid "Product Categories"
|
||||
msgstr "Catégories de produits"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__applied_on__1_customer_product_category
|
||||
msgid "Product Categories and Customers"
|
||||
msgstr "Catégories de produits et clients"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_account_move_line__product_categ_id
|
||||
msgid "Product Category"
|
||||
msgstr "Catégorie de produit"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__product_ids
|
||||
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__applied_on__2_product
|
||||
msgid "Products"
|
||||
msgstr "Produits"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields.selection,name:commission_simple.selection__commission_rule__applied_on__0_customer_product
|
||||
msgid "Products and Customers"
|
||||
msgstr "Produits et clients"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__profile_id
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__profile_id
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_rule_search
|
||||
msgid "Profile"
|
||||
msgstr "Profil"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_form
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_rule_tree
|
||||
msgid "Rate (%)"
|
||||
msgstr "Taux (%)"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.constraint,message:commission_simple.constraint_commission_rule_rate_positive
|
||||
msgid "Rate must be positive !"
|
||||
msgstr "Le taux doit être positif !"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__activity_user_id
|
||||
msgid "Responsible User"
|
||||
msgstr "Utilisateur responsable"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_profile_form
|
||||
msgid "Rules"
|
||||
msgstr "Règles"
|
||||
|
||||
#. module: commission_simple
|
||||
#. odoo-python
|
||||
#: code:addons/commission_simple/models/commission_profile.py:0
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__user_id
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple.commission_result_search
|
||||
#, python-format
|
||||
msgid "Salesman"
|
||||
msgstr "Vendeur"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__partner_id
|
||||
msgid "Salesman/Agent"
|
||||
msgstr "Vendeur/Agent"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__sequence
|
||||
msgid "Sequence"
|
||||
msgstr "Séquence"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_rule__date_start
|
||||
msgid "Start Date"
|
||||
msgstr "Date de début"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_compute__date_start
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__date_start
|
||||
msgid "Start date"
|
||||
msgstr "Date de début"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__state
|
||||
msgid "State"
|
||||
msgstr "État"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,help:commission_simple.field_commission_result__activity_state
|
||||
msgid ""
|
||||
"Status based on activities\n"
|
||||
"Overdue: Due date is already passed\n"
|
||||
"Today: Activity date is today\n"
|
||||
"Planned: Future activities."
|
||||
msgstr ""
|
||||
"Statut basé sur les activités\n"
|
||||
"En retard : La date d'échéance est déjà dépassée\n"
|
||||
"Aujourd'hui : La date de l'activité est aujourd'hui\n"
|
||||
"Planifié : Activités futures."
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.constraint,message:commission_simple.constraint_commission_profile_assignment_company_user_uniq
|
||||
msgid "This salesman already has an assignment in this company."
|
||||
msgstr "Ce vendeur a déjà une assignation dans cette société."
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile__trigger_type
|
||||
msgid "Trigger"
|
||||
msgstr "Déclencheur"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_profile_assignment__assign_type
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,help:commission_simple.field_commission_result__activity_exception_decoration
|
||||
msgid "Type of the exception activity on record."
|
||||
msgstr "Type de l'activité-alerte sur l'enregistrement."
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,field_description:commission_simple.field_commission_result__website_message_ids
|
||||
msgid "Website Messages"
|
||||
msgstr "Messages du site Web"
|
||||
|
||||
#. module: commission_simple
|
||||
#: model:ir.model.fields,help:commission_simple.field_commission_result__website_message_ids
|
||||
msgid "Website communication history"
|
||||
msgstr "Historique des échanges sur le site Web"
|
||||
|
||||
#. module: commission_simple
|
||||
#. odoo-python
|
||||
#: code:addons/commission_simple/models/commission_result.py:0
|
||||
#, python-format
|
||||
msgid "You cannot delete commission result %s because it is in done state."
|
||||
msgstr ""
|
||||
"Vous ne pouvez pas supprimer l'état de commission %s parce qu'il est à "
|
||||
"l'état \"validé\"."
|
||||
5
commission_simple/models/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from . import commission_profile
|
||||
from . import commission_rule
|
||||
from . import commission_result
|
||||
from . import res_company
|
||||
from . import account_move_line
|
||||
90
commission_simple/models/account_move_line.py
Normal file
@@ -0,0 +1,90 @@
|
||||
# Copyright 2019-2024 Akretion France (http://www.akretion.com/)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo.tools import float_is_zero
|
||||
|
||||
|
||||
class AccountMoveLine(models.Model):
|
||||
_inherit = 'account.move.line'
|
||||
|
||||
commission_result_id = fields.Many2one(
|
||||
'commission.result', string='Commission Result', check_company=True)
|
||||
commission_rule_id = fields.Many2one(
|
||||
'commission.rule', 'Matched Commission Rule', ondelete='restrict', check_company=True)
|
||||
commission_base = fields.Monetary('Commission Base', currency_field='company_currency_id')
|
||||
commission_rate = fields.Float('Commission Rate', digits='Commission Rate')
|
||||
commission_amount = fields.Monetary(
|
||||
string='Commission Amount', currency_field='company_currency_id',
|
||||
readonly=True, compute='_compute_commission_amount', store=True)
|
||||
# to display on commission line
|
||||
product_categ_id = fields.Many2one(
|
||||
related='product_id.product_tmpl_id.categ_id')
|
||||
|
||||
@api.depends('commission_rate', 'commission_base')
|
||||
def _compute_commission_amount(self):
|
||||
for line in self:
|
||||
commission_amount = False
|
||||
if not line.display_type:
|
||||
commission_amount = line.company_currency_id.round(
|
||||
line.commission_rate * line.commission_base / 100.0)
|
||||
line.commission_amount = commission_amount
|
||||
|
||||
def _match_commission_rule(self, rules):
|
||||
# commission rules are already in the right order
|
||||
self.ensure_one()
|
||||
for rule in rules:
|
||||
if rule['date_start'] and rule['date_start'] > self.date:
|
||||
continue
|
||||
if rule['date_end'] and rule['date_end'] < self.date:
|
||||
continue
|
||||
if rule['applied_on'] == '0_customer_product':
|
||||
if (
|
||||
self.partner_id.id in
|
||||
rule['partner_ids'] and
|
||||
self.product_id.id in rule['product_ids']):
|
||||
return rule
|
||||
elif rule['applied_on'] == '1_customer_product_category':
|
||||
if (
|
||||
self.partner_id.id in
|
||||
rule['partner_ids'] and
|
||||
self.product_categ_id.id in rule['product_categ_ids']):
|
||||
return rule
|
||||
elif rule['applied_on'] == '2_product':
|
||||
if self.product_id.id in rule['product_ids']:
|
||||
return rule
|
||||
elif rule['applied_on'] == '3_product_category':
|
||||
if self.product_categ_id.id in rule['product_categ_ids']:
|
||||
return rule
|
||||
elif rule['applied_on'] == '4_global':
|
||||
return rule
|
||||
return False
|
||||
|
||||
def _prepare_commission_data(self, rule):
|
||||
self.ensure_one()
|
||||
rate_prec = self.env['decimal.precision'].precision_get('Commission Rate')
|
||||
lvals = {
|
||||
'commission_rule_id': rule['id'],
|
||||
# company currency
|
||||
# inherit this method to change the value below if you want to base on margin
|
||||
# or something else
|
||||
'commission_rate': rule['rate'],
|
||||
}
|
||||
if rule['base'] == 'margin':
|
||||
# What do we do if it's negative ? For the moment, it adds a negative commission line
|
||||
cost = 0
|
||||
if self.product_id and self.product_uom_id:
|
||||
# if the module account_invoice_margin from akretion/odoo-usability is installed
|
||||
if hasattr(self, 'margin_company_currency'):
|
||||
cost = self.margin_company_currency
|
||||
else:
|
||||
sign = self.move_id.move_type == 'out_refund' and -1 or 1
|
||||
cost = self.product_id.standard_price * self.product_uom_id._compute_quantity(self.quantity, self.product_id.uom_id) * sign
|
||||
lvals['commission_base'] = self.balance * -1 - cost
|
||||
else:
|
||||
lvals['commission_base'] = self.balance * -1
|
||||
if float_is_zero(lvals['commission_rate'], precision_digits=rate_prec) or self.company_currency_id.is_zero(lvals['commission_base']):
|
||||
return False
|
||||
return lvals
|
||||
125
commission_simple/models/commission_profile.py
Normal file
@@ -0,0 +1,125 @@
|
||||
# Copyright Akretion France (http://www.akretion.com/)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
from odoo import fields, models, api, _
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class CommissionProfile(models.Model):
|
||||
_name = 'commission.profile'
|
||||
_description = 'Commission Profile'
|
||||
_order = 'sequence, id'
|
||||
|
||||
name = fields.Char(string='Name of the Profile', required=True)
|
||||
active = fields.Boolean(string='Active', default=True)
|
||||
sequence = fields.Integer()
|
||||
company_id = fields.Many2one(
|
||||
'res.company', string='Company', ondelete='cascade',
|
||||
required=False, default=lambda self: self.env.company)
|
||||
assign_ids = fields.One2many(
|
||||
'commission.profile.assignment', 'profile_id', string="Assignments")
|
||||
rule_ids = fields.One2many(
|
||||
'commission.rule', 'profile_id', string='Commission Rules')
|
||||
trigger_type = fields.Selection([
|
||||
('invoice', 'Invoiced'),
|
||||
('paid', 'Paid'),
|
||||
('in_payment', 'In Payment and Paid'),
|
||||
], default='paid', string='Trigger', required=True)
|
||||
|
||||
|
||||
class CommissionProfileAssignment(models.Model):
|
||||
_name = "commission.profile.assignment"
|
||||
_description = "Commission Profile Assignment"
|
||||
|
||||
profile_id = fields.Many2one('commission.profile', ondelete='cascade')
|
||||
company_id = fields.Many2one(
|
||||
'res.company', string='Company', ondelete='cascade',
|
||||
required=True, default=lambda self: self.env.company)
|
||||
assign_type = fields.Selection(
|
||||
'_assign_type_selection', default='user', required=True, string="Type")
|
||||
user_id = fields.Many2one(
|
||||
'res.users', compute="_compute_user_id", store=True, readonly=False,
|
||||
ondelete="restrict", string="Salesman",
|
||||
)
|
||||
|
||||
_sql_constraints = [
|
||||
(
|
||||
'company_user_uniq',
|
||||
'unique(user_id, company_id)',
|
||||
'This salesman already has an assignment in this company.')]
|
||||
|
||||
@api.model
|
||||
def _assign_type_selection(self):
|
||||
return [('user', _('Salesman'))]
|
||||
|
||||
@api.constrains('assign_type', 'user_id')
|
||||
def _check_user(self):
|
||||
for assignment in self:
|
||||
if assignment.assign_type == 'user' and not assignment.user_id:
|
||||
raise ValidationError(_("A salesman must be selected when the assignment type is 'Salesman'."))
|
||||
|
||||
@api.depends('assign_type')
|
||||
def _compute_user_id(self):
|
||||
for assign in self:
|
||||
if assign.assign_type != 'user':
|
||||
assign.user_id = False
|
||||
|
||||
def _get_partner(self):
|
||||
self.ensure_one()
|
||||
if self.assign_type == 'user':
|
||||
return self.user_id.partner_id
|
||||
return False
|
||||
|
||||
def _prepare_move_line_domain(self, date_range):
|
||||
self.ensure_one()
|
||||
domain = [
|
||||
('display_type', '=', False),
|
||||
('move_id.move_type', 'in', ('out_invoice', 'out_refund')),
|
||||
('date', '<=', date_range.date_end),
|
||||
('company_id', '=', self.company_id.id),
|
||||
('commission_result_id', '=', False),
|
||||
('parent_state', '=', 'posted'),
|
||||
]
|
||||
if self.assign_type == 'user':
|
||||
domain.append(('move_id.invoice_user_id', '=', self.user_id.id))
|
||||
# TODO : for trigger 'paid' and 'in_payment', we would need to filter
|
||||
# out the invoices paid after the end date of the commission period
|
||||
if self.profile_id.trigger_type == 'paid':
|
||||
domain.append(('move_id.payment_state', 'in', ('paid', 'reversed')))
|
||||
elif self.profile_id.trigger_type == 'in_payment':
|
||||
domain.append(('move_id.payment_state', 'in', ('in_payment', 'paid', 'reversed')))
|
||||
elif self.profile_id.trigger_type == 'invoice':
|
||||
domain.append(('date', '>=', date_range.date_start))
|
||||
return domain
|
||||
|
||||
def _prepare_commission_result(self, date_range):
|
||||
vals = {
|
||||
'partner_id': self._get_partner().id,
|
||||
'profile_id': self.profile_id.id,
|
||||
'date_range_id': date_range.id,
|
||||
'assign_type': self.assign_type,
|
||||
'company_id': self.company_id.id,
|
||||
}
|
||||
return vals
|
||||
|
||||
def _generate_commission_result(self, date_range, rules):
|
||||
self.ensure_one()
|
||||
ilines = self.env['account.move.line'].search(
|
||||
self._prepare_move_line_domain(date_range), order='date, move_id, sequence, id')
|
||||
profile = self.profile_id
|
||||
ilines2write = {}
|
||||
for iline in ilines:
|
||||
rule = iline._match_commission_rule(rules[profile.id])
|
||||
if rule:
|
||||
lvals = iline._prepare_commission_data(rule)
|
||||
if lvals:
|
||||
ilines2write[iline] = lvals
|
||||
if ilines2write:
|
||||
com_result = self.env['commission.result'].create(self._prepare_commission_result(date_range))
|
||||
for iline, vals in ilines2write.items():
|
||||
iline.write(dict(vals, commission_result_id=com_result.id))
|
||||
return com_result
|
||||
else:
|
||||
return False
|
||||
77
commission_simple/models/commission_result.py
Normal file
@@ -0,0 +1,77 @@
|
||||
# Copyright Akretion France (http://www.akretion.com/)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models, api, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class CommissionResult(models.Model):
|
||||
_name = 'commission.result'
|
||||
_description = "Commission Result"
|
||||
_order = 'date_start desc'
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
|
||||
partner_id = fields.Many2one(
|
||||
'res.partner', string='Salesman/Agent', required=True, ondelete='restrict',
|
||||
readonly=True, tracking=True)
|
||||
profile_id = fields.Many2one(
|
||||
'commission.profile', string='Commission Profile', readonly=True, tracking=True)
|
||||
assign_type = fields.Selection('_assign_type_selection', readonly=True, tracking=True)
|
||||
company_id = fields.Many2one(
|
||||
'res.company', string='Company', ondelete='cascade',
|
||||
required=True, readonly=True, default=lambda self: self.env.company, tracking=True)
|
||||
company_currency_id = fields.Many2one(
|
||||
related='company_id.currency_id', string='Company Currency', store=True)
|
||||
date_range_id = fields.Many2one(
|
||||
'date.range', required=True, string='Period', readonly=True, tracking=True)
|
||||
date_start = fields.Date(related='date_range_id.date_start', store=True)
|
||||
date_end = fields.Date(related='date_range_id.date_end', store=True)
|
||||
line_ids = fields.One2many(
|
||||
'account.move.line', 'commission_result_id', string='Commission Lines',
|
||||
states={'done': [('readonly', True)]})
|
||||
amount_total = fields.Monetary(
|
||||
string='Commission Total', currency_field='company_currency_id',
|
||||
compute='_compute_amount_total', store=True, tracking=True)
|
||||
state = fields.Selection([
|
||||
('draft', 'Draft'),
|
||||
('done', 'Done'),
|
||||
], default='draft', tracking=True)
|
||||
# TODO copy amount to another field
|
||||
# help='This is the total amount at the date of the computation of the commission')
|
||||
|
||||
@api.model
|
||||
def _assign_type_selection(self):
|
||||
return self.env['commission.profile.assignment']._assign_type_selection()
|
||||
|
||||
@api.depends('line_ids.commission_amount')
|
||||
def _compute_amount_total(self):
|
||||
rg_res = self.env['account.move.line'].read_group([('commission_result_id', 'in', self.ids)], ['commission_result_id', 'commission_amount:sum'], ['commission_result_id'])
|
||||
mapped_data = dict([(x['commission_result_id'][0], x['commission_amount']) for x in rg_res])
|
||||
for rec in self:
|
||||
rec.amount_total = mapped_data.get(rec.id, 0)
|
||||
|
||||
def unlink(self):
|
||||
for result in self:
|
||||
if result.state == 'done':
|
||||
raise UserError(_(
|
||||
"You cannot delete commission result %s because it is in done state.") % result.display_name)
|
||||
return super().unlink()
|
||||
|
||||
def draft2done(self):
|
||||
self.write({'state': 'done'})
|
||||
|
||||
def backtodraft(self):
|
||||
self.write({'state': 'draft'})
|
||||
|
||||
def name_get(self):
|
||||
res = []
|
||||
for result in self:
|
||||
name = '%s (%s)' % (result.partner_id.name, result.date_range_id.name)
|
||||
res.append((result.id, name))
|
||||
return res
|
||||
|
||||
_sql_constraints = [(
|
||||
'salesman_period_company_unique',
|
||||
'unique(company_id, partner_id, date_range_id)',
|
||||
'A commission result already exists for this salesman/agent for the same period.')]
|
||||
52
commission_simple/models/commission_rule.py
Normal file
@@ -0,0 +1,52 @@
|
||||
# Copyright Akretion France (http://www.akretion.com/)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
from odoo import fields, models, api
|
||||
|
||||
|
||||
class CommissionRule(models.Model):
|
||||
_name = 'commission.rule'
|
||||
_description = 'Commission Rule'
|
||||
_order = 'profile_id, applied_on'
|
||||
|
||||
partner_ids = fields.Many2many(
|
||||
'res.partner', string='Customers', domain=[('parent_id', '=', False)])
|
||||
product_categ_ids = fields.Many2many(
|
||||
'product.category', string="Product Categories")
|
||||
product_ids = fields.Many2many('product.product', string='Products')
|
||||
date_start = fields.Date('Start Date')
|
||||
date_end = fields.Date('End Date')
|
||||
profile_id = fields.Many2one(
|
||||
'commission.profile', string='Profile', ondelete='cascade')
|
||||
company_id = fields.Many2one(related='profile_id.company_id', store=True)
|
||||
rate = fields.Float('Commission Rate', digits="Commission Rate", copy=False)
|
||||
base = fields.Selection([
|
||||
('invoiced', 'Invoiced Amount'),
|
||||
('margin', 'Margin'),
|
||||
], default='invoiced', required=True, string="Commission Base")
|
||||
applied_on = fields.Selection([
|
||||
('0_customer_product', 'Products and Customers'),
|
||||
('1_customer_product_category', "Product Categories and Customers"),
|
||||
('2_product', "Products"),
|
||||
('3_product_category', "Product Categories"),
|
||||
('4_global', 'Global')],
|
||||
string='Apply On', default='4_global', required=True)
|
||||
active = fields.Boolean(string='Active', default=True)
|
||||
|
||||
@api.model
|
||||
def load_all_rules(self):
|
||||
rules = self.search_read([('profile_id', '!=', False)])
|
||||
res = {} # key = profile, value = [rule1 recordset, rule2]
|
||||
for rule in rules:
|
||||
if rule['profile_id'][0] not in res:
|
||||
res[rule['profile_id'][0]] = [rule]
|
||||
else:
|
||||
res[rule['profile_id'][0]].append(rule)
|
||||
return res
|
||||
|
||||
_sql_constraints = [(
|
||||
'rate_positive',
|
||||
'CHECK(rate >= 0)',
|
||||
'Rate must be positive !')]
|
||||
13
commission_simple/models/res_company.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Copyright 2019-2024 Akretion France (https://www.akretion.com/)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
commission_date_range_type_id = fields.Many2one(
|
||||
'date.range.type', string='Commission Periodicity', ondelete='restrict')
|
||||
11
commission_simple/security/ir.model.access.csv
Normal file
@@ -0,0 +1,11 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_commission_profile_read,Read access on commission.profile for employees,model_commission_profile,base.group_user,1,0,0,0
|
||||
access_commission_profile_full,Full access on commission.profile for financial manager,model_commission_profile,account.group_account_manager,1,1,1,1
|
||||
access_commission_profile_assignment_full,Full access on commission.profile.assignment for financial manager,model_commission_profile_assignment,account.group_account_manager,1,1,1,1
|
||||
access_commission_rule_full,Full access on commission.rule for financial manager,model_commission_rule,account.group_account_manager,1,1,1,1
|
||||
access_commission_rule_read,Read access on commission.rule for invoicing group,model_commission_rule,account.group_account_invoice,1,0,0,0
|
||||
access_commission_rule_audit,Read access on commission.rule for viewer group,model_commission_rule,account.group_account_readonly,1,0,0,0
|
||||
access_commission_result_full,Full access on commission.result to accountant,model_commission_result,account.group_account_user,1,1,1,1
|
||||
access_commission_result_read,Read access on commission.result to invoicing grp,model_commission_result,account.group_account_invoice,1,0,0,0
|
||||
access_commission_result_audit,Read access on commission.result to viewer grp,model_commission_result,account.group_account_readonly,1,0,0,0
|
||||
access_commission_compute_full,Full access to wizard commission.compute,model_commission_compute,account.group_account_manager,1,1,1,1
|
||||
|
29
commission_simple/security/rule.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2019-2024 Akretion France (https://www.akretion.com)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
-->
|
||||
|
||||
<odoo noupdate="1">
|
||||
|
||||
|
||||
<record id="commission_profile_rule" model="ir.rule">
|
||||
<field name="name">Commission Profile multi-company</field>
|
||||
<field name="model_id" ref="model_commission_profile"/>
|
||||
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_rule_rule" model="ir.rule">
|
||||
<field name="name">Commission Rule multi-company</field>
|
||||
<field name="model_id" ref="model_commission_rule"/>
|
||||
<field name="domain_force">[('company_id', 'in', company_ids + [False])]</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_result_rule" model="ir.rule">
|
||||
<field name="name">Commission Result multi-company</field>
|
||||
<field name="model_id" ref="model_commission_result"/>
|
||||
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
BIN
commission_simple/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
34
commission_simple/views/account_move_line.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2024 Akretion France (https://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="view_move_line_form" model="ir.ui.view">
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page name="commission" string="Commission" attrs="{'invisible': [('display_type', '!=', False)]}">
|
||||
<group name="commission_grp">
|
||||
<field name="commission_base"/>
|
||||
<label for="commission_rate"/>
|
||||
<div name="commission_rate">
|
||||
<field name="commission_rate" class="oe_inline"/> %
|
||||
</div>
|
||||
<field name="commission_amount"/>
|
||||
<field name="commission_rule_id"/>
|
||||
<field name="display_type" invisible="1"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
206
commission_simple/views/commission.xml
Normal file
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2019 Akretion France (http://www.akretion.com)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<menuitem id="commission_root" name="Commissions" parent="account.menu_finance" sequence="11"/>
|
||||
<menuitem id="commission_config_root" name="Commissions" parent="account.menu_finance_configuration" sequence="110"/>
|
||||
|
||||
<!-- PROFILE -->
|
||||
<record id="commission_profile_form" model="ir.ui.view">
|
||||
<field name="name">commission.profile.form</field>
|
||||
<field name="model">commission.profile</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
|
||||
<group name="main">
|
||||
<field name="name"/>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="trigger_type"/>
|
||||
</group>
|
||||
<group name="lines" string="Rules">
|
||||
<field name="line_ids" nolabel="1" colspan="2"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_profile_tree" model="ir.ui.view">
|
||||
<field name="name">commission.profile.tree</field>
|
||||
<field name="model">commission.profile</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name" decoration-bf="1"/>
|
||||
<field name="trigger_type" optional="show"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_profile_action" model="ir.actions.act_window">
|
||||
<field name="name">Commission Profiles</field>
|
||||
<field name="res_model">commission.profile</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="commission_profile_menu" action="commission_profile_action" parent="commission_config_root" sequence="18"/>
|
||||
|
||||
|
||||
<!-- RULE -->
|
||||
<record id="commission_rule_form" model="ir.ui.view">
|
||||
<field name="name">commission.rule.form</field>
|
||||
<field name="model">commission.rule</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<group name="main">
|
||||
<field name="profile_id" invisible="not context.get('commission_rule_main_view')"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="applied_on" widget="radio"/>
|
||||
</group>
|
||||
<group name="match" string="Match">
|
||||
<field name="partner_ids" attrs="{'invisible': [('applied_on', 'not in', ('0_customer_product', '1_customer_product_category'))], 'required': [('applied_on', 'in', ('0_customer_product', '1_customer_product_category'))]}"/>
|
||||
<field name="product_categ_ids" attrs="{'invisible': [('applied_on', 'not in', ('1_customer_product_category', '3_product_category'))], 'required': [('applied_on', 'in', ('1_customer_product_category', '3_product_category'))]}"/>
|
||||
<field name="product_ids" attrs="{'invisible': [('applied_on', 'not in', ('0_customer_product', '2_product'))], 'required': [('applied_on', 'in', ('0_customer_product', '2_product'))]}"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
</group>
|
||||
<group name="compute" string="Compute">
|
||||
<label for="rate"/>
|
||||
<div name="rate">
|
||||
<field name="rate" class="oe_inline"/> %
|
||||
</div>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_rule_tree" model="ir.ui.view">
|
||||
<field name="name">commission.rule.tree</field>
|
||||
<field name="model">commission.rule</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="profile_id" invisible="not context.get('commission_rule_main_view')"/>
|
||||
<field name="applied_on"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
<field name="rate" string="Rate (%)"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_rule_search" model="ir.ui.view">
|
||||
<field name="name">commission.rule.search</field>
|
||||
<field name="model">commission.rule</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
|
||||
<group name="groupby">
|
||||
<filter name="profile_groupby" string="Profile" context="{'group_by': 'profile_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="commission_rule_action" model="ir.actions.act_window">
|
||||
<field name="name">Commission Rules</field>
|
||||
<field name="res_model">commission.rule</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'commission_rule_main_view': True}</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem id="commission_rule_menu" action="commission_rule_action" parent="commission_config_root" sequence="20"/>
|
||||
|
||||
<!-- RESULT -->
|
||||
<record id="commission_result_form" model="ir.ui.view">
|
||||
<field name="name">commission.result.form</field>
|
||||
<field name="model">commission.result</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<group name="main">
|
||||
<group name="main-left">
|
||||
<field name="partner_id"/>
|
||||
<field name="profile_id" groups="account.group_account_manager"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="amount_total"/>
|
||||
</group>
|
||||
<group name="main-right">
|
||||
<field name="date_range_id"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="lines" string="Commission Lines">
|
||||
<field nolabel="1" name="line_ids" colspan="2">
|
||||
<tree>
|
||||
<field name="move_id"/>
|
||||
<field name="move_line_id"/>
|
||||
<field name="base"/>
|
||||
<field name="rate" string="Rate (%)"/>
|
||||
<field name="amount" sum="1"/>
|
||||
<field name="rule_id"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_result_tree" model="ir.ui.view">
|
||||
<field name="name">commission.result.tree</field>
|
||||
<field name="model">commission.result</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="date_range_id" optional="show"/>
|
||||
<field name="date_start" optional="hide"/>
|
||||
<field name="date_end" optional="hide"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="profile_id" groups="account.group_account_manager"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="amount_total" sum="1" optional="show"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_result_search" model="ir.ui.view">
|
||||
<field name="name">commission.result.search</field>
|
||||
<field name="model">commission.result</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="partner_id"/>
|
||||
<field name="date_range_id"/>
|
||||
<group name="groupby">
|
||||
<filter name="partner_groupby" string="Salesman" context="{'group_by': 'partner_id'}"/>
|
||||
<filter name="date_range_groupby" string="Period" context="{'group_by': 'date_range_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_result_action" model="ir.actions.act_window">
|
||||
<field name="name">Commissions</field>
|
||||
<field name="res_model">commission.result</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="commission_result_menu" action="commission_result_action" parent="commission_root" sequence="10"/>
|
||||
|
||||
|
||||
</odoo>
|
||||
73
commission_simple/views/commission_profile.xml
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2019-2024 Akretion France (http://www.akretion.com)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<menuitem id="commission_root" name="Commissions" parent="account.menu_finance" sequence="11"/>
|
||||
<menuitem id="commission_config_root" name="Commissions" parent="account.menu_finance_configuration" sequence="110"/>
|
||||
|
||||
<record id="commission_profile_form" model="ir.ui.view">
|
||||
<field name="name">commission.profile.form</field>
|
||||
<field name="model">commission.profile</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
|
||||
<group name="main">
|
||||
<group name="main-left">
|
||||
<field name="name"/>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="trigger_type" widget="radio"/>
|
||||
</group>
|
||||
<group name="main-right">
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page name="assignments" string="Assignments">
|
||||
<field name="assign_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="assign_type"/>
|
||||
<field name="user_id" attrs="{'required': [('assign_type', '=', 'user')], 'readonly': [('assign_type', '!=', 'user')]}"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page name="rules" string="Rules">
|
||||
<field name="rule_ids"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_profile_tree" model="ir.ui.view">
|
||||
<field name="name">commission.profile.tree</field>
|
||||
<field name="model">commission.profile</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="name" decoration-bf="1"/>
|
||||
<field name="trigger_type" optional="show"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_profile_action" model="ir.actions.act_window">
|
||||
<field name="name">Commission Profiles</field>
|
||||
<field name="res_model">commission.profile</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="commission_profile_menu" action="commission_profile_action" parent="commission_config_root" sequence="18"/>
|
||||
|
||||
|
||||
</odoo>
|
||||
113
commission_simple/views/commission_result.xml
Normal file
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2024 Akretion France (http://www.akretion.com)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="commission_result_form" model="ir.ui.view">
|
||||
<field name="name">commission.result.form</field>
|
||||
<field name="model">commission.result</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<header>
|
||||
<button name="draft2done" type="object" states="draft" string="Confirm" class="btn-primary"/>
|
||||
<button name="backtodraft" type="object" states="done" string="Back to Draft" confirm="Are you sure you want to go back to draft?"/>
|
||||
<field name="state" widget="statusbar"/>
|
||||
</header>
|
||||
<group name="main">
|
||||
<group name="main-left">
|
||||
<field name="partner_id"/>
|
||||
<field name="date_range_id"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
<field name="amount_total"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
</group>
|
||||
<group name="main-right">
|
||||
<field name="profile_id" groups="account.group_account_manager"/>
|
||||
<field name="assign_type"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="lines" string="Commission Lines">
|
||||
<field nolabel="1" name="line_ids" colspan="2">
|
||||
<tree>
|
||||
<field name="move_id"/>
|
||||
<field name="date" optional="hide"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="product_categ_id" optional="hide"/>
|
||||
<field name="name" optional="hide"/>
|
||||
<field name="price_subtotal" optional="hide" string="Invoiced Amount"/>
|
||||
<field name="commission_base"/>
|
||||
<field name="commission_rate" string="Rate (%)"/>
|
||||
<field name="commission_amount" sum="1"/>
|
||||
<field name="commission_rule_id" optional="hide"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="activity_ids" widget="mail_activity"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_result_tree" model="ir.ui.view">
|
||||
<field name="name">commission.result.tree</field>
|
||||
<field name="model">commission.result</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree decoration-info="state == 'draft'">
|
||||
<field name="date_range_id" optional="show"/>
|
||||
<field name="date_start" optional="hide"/>
|
||||
<field name="date_end" optional="hide"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="profile_id" groups="account.group_account_manager"/>
|
||||
<field name="assign_type" optional="hide" widget="badge" decoration-warning="assign_type == 'user'"/>
|
||||
<field name="company_currency_id" invisible="1"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="amount_total" sum="1" optional="show"/>
|
||||
<field name="state" decoration-info="state == 'draft'" decoration-success="state == 'done'" widget="badge"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_result_search" model="ir.ui.view">
|
||||
<field name="name">commission.result.search</field>
|
||||
<field name="model">commission.result</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="partner_id"/>
|
||||
<field name="date_range_id"/>
|
||||
<separator/>
|
||||
<filter name="draft" domain="[('state', '=', 'draft')]" string="Draft"/>
|
||||
<filter name="done" domain="[('state', '=', 'done')]" string="Done"/>
|
||||
<separator/>
|
||||
<filter name="user" domain="[('assign_type', '=', 'user')]" string="Salesman"/>
|
||||
<group name="groupby">
|
||||
<filter name="partner_groupby" string="Salesman" context="{'group_by': 'partner_id'}"/>
|
||||
<filter name="date_range_groupby" string="Period" context="{'group_by': 'date_range_id'}"/>
|
||||
<filter name="assign_type_groupby" string="Assign Type" context="{'group_by': 'assign_type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_result_action" model="ir.actions.act_window">
|
||||
<field name="name">Commissions</field>
|
||||
<field name="res_model">commission.result</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="commission_result_menu" action="commission_result_action" parent="commission_root" sequence="10"/>
|
||||
|
||||
|
||||
</odoo>
|
||||
81
commission_simple/views/commission_rule.xml
Normal file
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2019 Akretion France (http://www.akretion.com)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="commission_rule_form" model="ir.ui.view">
|
||||
<field name="name">commission.rule.form</field>
|
||||
<field name="model">commission.rule</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<group name="main">
|
||||
<field name="profile_id" invisible="not context.get('commission_rule_main_view')"/>
|
||||
<field name="applied_on" widget="radio"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
</group>
|
||||
<group name="match" string="Match">
|
||||
<field name="partner_ids" attrs="{'invisible': [('applied_on', 'not in', ('0_customer_product', '1_customer_product_category'))], 'required': [('applied_on', 'in', ('0_customer_product', '1_customer_product_category'))]}"/>
|
||||
<field name="product_categ_ids" attrs="{'invisible': [('applied_on', 'not in', ('1_customer_product_category', '3_product_category'))], 'required': [('applied_on', 'in', ('1_customer_product_category', '3_product_category'))]}"/>
|
||||
<field name="product_ids" attrs="{'invisible': [('applied_on', 'not in', ('0_customer_product', '2_product'))], 'required': [('applied_on', 'in', ('0_customer_product', '2_product'))]}"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
</group>
|
||||
<group name="compute" string="Compute">
|
||||
<label for="rate"/>
|
||||
<div name="rate">
|
||||
<field name="rate" class="oe_inline"/> %
|
||||
</div>
|
||||
<field name="base" widget="radio"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_rule_tree" model="ir.ui.view">
|
||||
<field name="name">commission.rule.tree</field>
|
||||
<field name="model">commission.rule</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="profile_id" invisible="not context.get('commission_rule_main_view')"/>
|
||||
<field name="applied_on"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
<field name="rate" string="Rate (%)"/>
|
||||
<field name="base"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_rule_search" model="ir.ui.view">
|
||||
<field name="name">commission.rule.search</field>
|
||||
<field name="model">commission.rule</field>
|
||||
<field name="arch" type="xml">
|
||||
<search>
|
||||
<field name="profile_id"/>
|
||||
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
|
||||
<group name="groupby">
|
||||
<filter name="profile_groupby" string="Profile" context="{'group_by': 'profile_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="commission_rule_action" model="ir.actions.act_window">
|
||||
<field name="name">Commission Rules</field>
|
||||
<field name="res_model">commission.rule</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'commission_rule_main_view': True}</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem id="commission_rule_menu" action="commission_rule_action" parent="commission_config_root" sequence="20"/>
|
||||
|
||||
|
||||
</odoo>
|
||||
37
commission_simple/views/res_config_settings.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2019-2025 Akretion France (https://www.akretion.com)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="res_config_settings_view_form" model="ir.ui.view">
|
||||
<field name="name">commission.res.config.settings.form</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="account.res_config_settings_view_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@id='analytic']" position="after">
|
||||
<h2>Commissions</h2>
|
||||
<div class="row mt16 o_settings_container" id="commission_simple">
|
||||
<div class="col-12 col-lg-12 o_setting_box" id="commission_simple-settings">
|
||||
<div class="o_setting_left_pane" />
|
||||
<div class="o_setting_right_pane">
|
||||
<div class="row" id="commission_date_range_type_id">
|
||||
<label
|
||||
for="commission_date_range_type_id"
|
||||
class="col-md-5"
|
||||
/>
|
||||
<field name="commission_date_range_type_id" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
2
commission_simple/wizards/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import commission_compute
|
||||
from . import res_config_settings
|
||||
77
commission_simple/wizards/commission_compute.py
Normal file
@@ -0,0 +1,77 @@
|
||||
# Copyright 2019-2024 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from odoo.exceptions import UserError
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class CommissionCompute(models.TransientModel):
|
||||
_name = 'commission.compute'
|
||||
_description = 'Compute Commissions'
|
||||
|
||||
company_id = fields.Many2one('res.company', required=True, default=lambda self: self.env.company)
|
||||
date_range_type_id = fields.Many2one(related='company_id.commission_date_range_type_id')
|
||||
date_range_id = fields.Many2one(
|
||||
'date.range', required=True, string='Period',
|
||||
compute='_compute_date_range_id', store=True, readonly=False,
|
||||
domain="[('type_id', '=', date_range_type_id)]")
|
||||
date_start = fields.Date(related='date_range_id.date_start')
|
||||
date_end = fields.Date(related='date_range_id.date_end')
|
||||
|
||||
@api.depends('company_id')
|
||||
def _compute_date_range_id(self):
|
||||
for wiz in self:
|
||||
date_range_id = False
|
||||
company = wiz.company_id
|
||||
if company and company.commission_date_range_type_id:
|
||||
type_id = company.commission_date_range_type_id.id
|
||||
last_commission_result = self.env['commission.result'].search([
|
||||
('company_id', '=', company.id),
|
||||
], order='date_end desc', limit=1)
|
||||
limit_date = last_commission_result and last_commission_result.date_end or (fields.Date.context_today(self) + relativedelta(months=-2, day=31))
|
||||
date_range = self.env['date.range'].search([
|
||||
('company_id', 'in', (company.id, False)),
|
||||
('type_id', '=', type_id),
|
||||
('date_start', '>', limit_date)
|
||||
], order='date_start', limit=1)
|
||||
date_range_id = date_range and date_range.id or False
|
||||
wiz.date_range_id = date_range_id
|
||||
|
||||
def run(self):
|
||||
self.ensure_one()
|
||||
creso = self.env['commission.result']
|
||||
date_range = self.date_range_id
|
||||
existing_commissions = creso.search([
|
||||
('date_range_id', '=', date_range.id),
|
||||
('company_id', '=', self.company_id.id),
|
||||
])
|
||||
if existing_commissions:
|
||||
raise UserError(_(
|
||||
'Commissions already exist for %(period)s in company %(company)s.',
|
||||
period=date_range.display_name, company=self.company_id.display_name))
|
||||
com_result_ids = self._core_compute()
|
||||
if not com_result_ids:
|
||||
raise UserError(_('No commissions generated.'))
|
||||
action = self.env['ir.actions.actions']._for_xml_id(
|
||||
'commission_simple.commission_result_action')
|
||||
action.update({
|
||||
'views': False,
|
||||
'domain': f"[('id', 'in', {com_result_ids})]",
|
||||
})
|
||||
return action
|
||||
|
||||
def _core_compute(self):
|
||||
rules = self.env['commission.rule'].load_all_rules()
|
||||
com_result_ids = []
|
||||
assignments = self.env['commission.profile.assignment'].search([('company_id', '=', self.company_id.id)])
|
||||
for assignment in assignments:
|
||||
com_result = assignment._generate_commission_result(self.date_range_id, rules)
|
||||
if com_result:
|
||||
com_result_ids.append(com_result.id)
|
||||
else:
|
||||
logger.info("No commission for %s", assignment._get_partner().display_name)
|
||||
return com_result_ids
|
||||
41
commission_simple/wizards/commission_compute_view.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2019-2024 Akretion France (https://www.akretion.com)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="commission_compute_form" model="ir.ui.view">
|
||||
<field name="name">commission.compute.form</field>
|
||||
<field name="model">commission.compute</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<group name="main">
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="date_range_type_id" invisible="1"/>
|
||||
<field name="date_range_id"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="run" type="object" string="Compute"
|
||||
class="btn-primary"/>
|
||||
<button special="cancel" string="Cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="commission_compute_action" model="ir.actions.act_window">
|
||||
<field name="name">Compute Commissions</field>
|
||||
<field name="res_model">commission.compute</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="commission_compute_menu" action="commission_compute_action" parent="commission_root" sequence="15" groups="account.group_account_user"/>
|
||||
|
||||
</odoo>
|
||||
12
commission_simple/wizards/res_config_settings.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# Copyright 2019-2024 Akretion France (https://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
commission_date_range_type_id = fields.Many2one(
|
||||
related='company_id.commission_date_range_type_id', readonly=False)
|
||||
@@ -1,2 +1 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
22
commission_simple_agent/__manifest__.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright 2019-2025 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Commission Simple Agent',
|
||||
'version': '14.0.1.0.0',
|
||||
'category': 'Sales',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Glue module between commission_simple and sale_agent',
|
||||
'author': 'Akretion',
|
||||
'website': 'https://github.com/akretion/odoo-usability',
|
||||
'depends': [
|
||||
'commission_simple',
|
||||
'sale_agent',
|
||||
],
|
||||
'data': [
|
||||
'views/commission_profile.xml',
|
||||
'views/commission_result.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
44
commission_simple_agent/i18n/fr.po
Normal file
@@ -0,0 +1,44 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * commission_simple_agent
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-11-29 23:32+0000\n"
|
||||
"PO-Revision-Date: 2024-11-29 23:32+0000\n"
|
||||
"Last-Translator: Alexis de Lattre <alexis.delattre@akretion.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: commission_simple_agent
|
||||
#. odoo-python
|
||||
#: code:addons/commission_simple_agent/models/commission_profile_assignment.py:0
|
||||
#: model:ir.model.fields,field_description:commission_simple_agent.field_commission_profile_assignment__agent_id
|
||||
#: model_terms:ir.ui.view,arch_db:commission_simple_agent.commission_result_search
|
||||
#, python-format
|
||||
msgid "Agent"
|
||||
msgstr "Agent"
|
||||
|
||||
#. module: commission_simple_agent
|
||||
#. odoo-python
|
||||
#: code:addons/commission_simple_agent/models/commission_profile_assignment.py:0
|
||||
#, python-format
|
||||
msgid "An agent must be selected when the assignment type is 'Agent'."
|
||||
msgstr ""
|
||||
"Un agent doit être sélectionné lorsque le type d'affectation est \"Agent\"."
|
||||
|
||||
#. module: commission_simple_agent
|
||||
#: model:ir.model,name:commission_simple_agent.model_commission_profile_assignment
|
||||
msgid "Commission Profile Assignment"
|
||||
msgstr "Affectation du profil de commission"
|
||||
|
||||
#. module: commission_simple_agent
|
||||
#: model:ir.model.constraint,message:commission_simple_agent.constraint_commission_profile_assignment_company_agent_uniq
|
||||
msgid "This agent already has an assignment in this company."
|
||||
msgstr "Cet agent a déjà une affectation dans cette société."
|
||||
1
commission_simple_agent/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import commission_profile_assignment
|
||||
@@ -0,0 +1,51 @@
|
||||
# Copyright Akretion France (http://www.akretion.com/)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class CommissionProfileAssignment(models.Model):
|
||||
_inherit = "commission.profile.assignment"
|
||||
|
||||
agent_id = fields.Many2one(
|
||||
'res.partner', ondelete='restrict',
|
||||
compute="_compute_agent_id", store=True, readonly=False,
|
||||
domain=[('agent', '=', True)])
|
||||
|
||||
_sql_constraints = [
|
||||
(
|
||||
'company_agent_uniq',
|
||||
'unique(agent_id, company_id)',
|
||||
'This agent already has an assignment in this company.')]
|
||||
|
||||
@api.model
|
||||
def _assign_type_selection(self):
|
||||
sel = super()._assign_type_selection()
|
||||
sel.append(('agent', _('Agent')))
|
||||
return sel
|
||||
|
||||
@api.constrains('assign_type', 'agent_id')
|
||||
def _check_agent(self):
|
||||
for assignment in self:
|
||||
if assignment.assign_type == 'agent' and not assignment.agent_id:
|
||||
raise ValidationError(_("An agent must be selected when the assignment type is 'Agent'."))
|
||||
|
||||
@api.depends('assign_type')
|
||||
def _compute_agent_id(self):
|
||||
for assign in self:
|
||||
if assign.assign_type != 'agent':
|
||||
assign.agent_id = False
|
||||
|
||||
def _prepare_move_line_domain(self, date_range):
|
||||
domain = super()._prepare_move_line_domain(date_range)
|
||||
if self.assign_type == 'agent':
|
||||
domain.append(('move_id.invoice_agent_id', '=', self.agent_id.id))
|
||||
return domain
|
||||
|
||||
def _get_partner(self):
|
||||
self.ensure_one()
|
||||
if self.assign_type == 'agent':
|
||||
return self.agent_id
|
||||
return super()._get_partner()
|
||||
BIN
commission_simple_agent/static/description/icon.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
21
commission_simple_agent/views/commission_profile.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2024 Akretion France (https://www.akretion.com)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="commission_profile_form" model="ir.ui.view">
|
||||
<field name="model">commission.profile</field>
|
||||
<field name="inherit_id" ref="commission_simple.commission_profile_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='assign_ids']/tree/field[@name='user_id']" position="after">
|
||||
<field name="agent_id" attrs="{'required': [('assign_type', '=', 'agent')], 'readonly': [('assign_type', '!=', 'agent')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
32
commission_simple_agent/views/commission_result.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2024 Akretion France (https://www.akretion.com)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="commission_result_tree" model="ir.ui.view">
|
||||
<field name="model">commission.result</field>
|
||||
<field name="inherit_id" ref="commission_simple.commission_result_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="assign_type" position="attributes">
|
||||
<attribute name="decoration-danger">assign_type == 'agent'</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<record id="commission_result_search" model="ir.ui.view">
|
||||
<field name="model">commission.result</field>
|
||||
<field name="inherit_id" ref="commission_simple.commission_result_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="user" position="after">
|
||||
<filter name="agent" domain="[('assign_type', '=', 'agent')]" string="Agent"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||