Compare commits
146 Commits
14-adapt-u
...
14.0-produ
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b8709a425 | ||
|
|
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 | ||
|
|
f2172a5f06 | ||
|
|
e81e8e5a93 | ||
|
|
a7b0210a90 | ||
|
|
cd30298f88 | ||
|
|
5039e56417 | ||
|
|
3c338c9c78 | ||
|
|
2c87670281 | ||
|
|
59e34d0166 | ||
|
|
0e87b385d4 | ||
|
|
4a434d69f9 | ||
|
|
bade674c41 | ||
|
|
def89c0a5d | ||
|
|
88b12d86a2 | ||
|
|
e3c55047b3 | ||
|
|
b701586edc | ||
|
|
aae3ac2898 | ||
|
|
8a2e23cff5 | ||
|
|
0781cb7ba7 | ||
|
|
a7022e899f | ||
|
|
068509066d | ||
|
|
e594d15417 | ||
|
|
4121d8466d | ||
|
|
6df9756479 | ||
|
|
0331cc8eda | ||
|
|
54bc3d8af8 | ||
|
|
15edfe5603 | ||
|
|
8bf2116630 | ||
|
|
6b5282994a | ||
|
|
993aab7d18 | ||
|
|
73137ee1fb | ||
|
|
c4ec388380 | ||
|
|
8afcd49bc3 | ||
|
|
1e8f00d4e1 | ||
|
|
061efb2197 | ||
|
|
e698746dd1 | ||
|
|
d2bc7be9fe | ||
|
|
5f6b731e50 | ||
|
|
6c81ade7d0 | ||
|
|
209de4f6db | ||
|
|
fd31627fa6 | ||
|
|
2863de99f4 | ||
|
|
16ed41187f | ||
|
|
7129dd1cce | ||
|
|
2d3a792ce8 | ||
|
|
d2cf9b73d8 | ||
|
|
d6cf5f82e7 | ||
|
|
e9350bac57 | ||
|
|
2e267d717f | ||
|
|
e8b43b67c1 | ||
|
|
f2b5b0b4dd | ||
|
|
a64c60a540 | ||
|
|
b48db5492d | ||
|
|
9026660416 | ||
|
|
d2a9f953b9 | ||
|
|
acff0a421d | ||
|
|
64f54a9389 | ||
|
|
08db759977 | ||
|
|
e07df6b45a | ||
|
|
fc58a9adf5 | ||
|
|
1d463a744d | ||
|
|
dbad21c13a | ||
|
|
aa16b70bdd | ||
|
|
eff63f2be2 | ||
|
|
937595ca2c | ||
|
|
9397bb9fce | ||
|
|
390ce75827 | ||
|
|
819d145763 | ||
|
|
45bbcc0cb3 | ||
|
|
6ddc1b86d5 | ||
|
|
d0b315f648 | ||
|
|
f1eeaa2e8a | ||
|
|
553f05c58f | ||
|
|
50ae5dc9cb | ||
|
|
9c7775dabb | ||
|
|
70f1f13edd | ||
|
|
989960c7c8 | ||
|
|
9b186028c3 | ||
|
|
c2c4957686 | ||
|
|
d382aea22f | ||
|
|
688a07fc5e |
27
account_bank_reconciliation_summary_xlsx/README.rst
Normal file
27
account_bank_reconciliation_summary_xlsx/README.rst
Normal file
@@ -0,0 +1,27 @@
|
||||
===============================
|
||||
Bank Reconciliation Report XLSX
|
||||
===============================
|
||||
|
||||
In Odoo v13+, a bank reconciliation report is not really needed because all the payments executed that are not debited/credited on the bank account are in separate waiting accounts. But accountants want a bank reconciliation report, so this module adds one, even if it is quite different from a classic bank reconciliation report.
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
This module doesn't require any configuration.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
You can launch the Bank Reconciliation Report wizard from:
|
||||
|
||||
* the menu *Accounting > Reports > Bank > Bank Reconciliation*,
|
||||
* the invoicing dashboard: on a bank journal, click on the options, then select *Bank Reconciliation*.
|
||||
* the form view of a bank statement: click on the button *Bank Reconciliation Report*.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
@@ -1 +1,2 @@
|
||||
from . import report
|
||||
from . import wizard
|
||||
21
account_bank_reconciliation_summary_xlsx/__manifest__.py
Normal file
21
account_bank_reconciliation_summary_xlsx/__manifest__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# 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.2.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "Akretion",
|
||||
"website": "https://github.com/akretion/odoo-usability",
|
||||
"summary": "Bank reconciliation XLSX report",
|
||||
"depends": ["account", "report_xlsx"],
|
||||
"data": [
|
||||
"report/report.xml",
|
||||
"wizard/bank_reconciliation_report_wizard_view.xml",
|
||||
"views/account_bank_statement.xml",
|
||||
"views/account_journal.xml",
|
||||
"security/ir.model.access.csv",
|
||||
],
|
||||
"installable": True,
|
||||
}
|
||||
268
account_bank_reconciliation_summary_xlsx/i18n/fr.po
Normal file
268
account_bank_reconciliation_summary_xlsx/i18n/fr.po
Normal file
@@ -0,0 +1,268 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_bank_reconciliation_summary_xlsx
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \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"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. 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"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
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"
|
||||
msgstr "Journaux de banque"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.actions.act_window,name:account_bank_reconciliation_summary_xlsx.bank_reconciliation_report_wizard_action
|
||||
#: model:ir.ui.menu,name:account_bank_reconciliation_summary_xlsx.bank_reconciliation_report_wizard_menu
|
||||
#: model_terms:ir.ui.view,arch_db:account_bank_reconciliation_summary_xlsx.account_journal_dashboard_kanban_view
|
||||
msgid "Bank Reconciliation"
|
||||
msgstr "Rapprochement bancaire"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#: model_terms:ir.ui.view,arch_db:account_bank_reconciliation_summary_xlsx.view_bank_statement_form
|
||||
#, python-format
|
||||
msgid "Bank Reconciliation Report"
|
||||
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 de rapport de rapprochement bancaire"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.actions.report,name:account_bank_reconciliation_summary_xlsx.bank_reconciliation_xlsx
|
||||
msgid "Bank Reconciliation XLSX"
|
||||
msgstr "Rapprochement bancaire XLSX"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.model,name:account_bank_reconciliation_summary_xlsx.model_report_bank_reconciliation_xlsx
|
||||
msgid "Bank Reconciliation XLSX Report"
|
||||
msgstr "Rapport de rapprochement bancaire XLSX"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.ui.menu,name:account_bank_reconciliation_summary_xlsx.menu_report_bank_root
|
||||
msgid "Bank Reports"
|
||||
msgstr "Rapports bancaires"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model_terms:ir.ui.view,arch_db:account_bank_reconciliation_summary_xlsx.bank_reconciliation_report_wizard_form
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: 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__company_id
|
||||
#, python-format
|
||||
msgid "Company"
|
||||
msgstr "Société"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "Counter-part"
|
||||
msgstr "Contre partie"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.model.fields,field_description:account_bank_reconciliation_summary_xlsx.field_bank_reconciliation_report_wizard__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Créé par"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.model.fields,field_description:account_bank_reconciliation_summary_xlsx.field_bank_reconciliation_report_wizard__create_date
|
||||
msgid "Created on"
|
||||
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 "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 "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
|
||||
msgid "Draft and Posted Entries"
|
||||
msgstr "Écritures brouillon et comptabilisées"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: 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__move_state
|
||||
#, python-format
|
||||
msgid "Entries"
|
||||
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 "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 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
|
||||
#: model:ir.model.fields,field_description:account_bank_reconciliation_summary_xlsx.field_report_bank_reconciliation_xlsx__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
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
|
||||
msgid "Label"
|
||||
msgstr "Libellé"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: 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 "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 "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 "Dernière mise à jour le"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "No bank journal selected."
|
||||
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
|
||||
msgid "Partner"
|
||||
msgstr "Partenaire"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: model:ir.model.fields.selection,name:account_bank_reconciliation_summary_xlsx.selection__bank_reconciliation_report_wizard__move_state__posted
|
||||
msgid "Posted Entries"
|
||||
msgstr "Écritures comptabilisées"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "Ref."
|
||||
msgstr "Réf."
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, python-format
|
||||
msgid "Sub-total:"
|
||||
msgstr "Sous-total :"
|
||||
|
||||
#. module: account_bank_reconciliation_summary_xlsx
|
||||
#: code:addons/account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py:0
|
||||
#, 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."
|
||||
@@ -0,0 +1 @@
|
||||
from . import bank_reconciliation_xlsx
|
||||
@@ -0,0 +1,375 @@
|
||||
# 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).
|
||||
|
||||
from odoo import _, models
|
||||
from odoo.exceptions import UserError
|
||||
from datetime import datetime
|
||||
from odoo.tools.misc import format_datetime
|
||||
import pytz
|
||||
|
||||
|
||||
class BankReconciliationXlsx(models.AbstractModel):
|
||||
_name = "report.bank.reconciliation.xlsx"
|
||||
_description = "Bank Reconciliation XLSX Report"
|
||||
_inherit = "report.report_xlsx.abstract"
|
||||
|
||||
def _prepare_payment_move_lines(self, jdi, account, unreconciled_only=True):
|
||||
domain = [
|
||||
("company_id", "=", jdi['company'].id),
|
||||
("account_id", "=", account.id),
|
||||
("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(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)
|
||||
limit_datetime = limit_datetime_utc.replace(tzinfo=None)
|
||||
domain += [
|
||||
'|', ('full_reconcile_id', '=', False),
|
||||
('full_reconcile_id.create_date', '>', limit_datetime)]
|
||||
mlines = self.env["account.move.line"].search(domain)
|
||||
res = []
|
||||
for mline in mlines:
|
||||
move = mline.move_id
|
||||
cpart = []
|
||||
for line in move.line_ids:
|
||||
if (
|
||||
line.account_id != account
|
||||
and line.account_id.code not in cpart
|
||||
):
|
||||
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": amount,
|
||||
"move_name": move.name,
|
||||
"counterpart": counterpart,
|
||||
}
|
||||
)
|
||||
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, account)
|
||||
if mlines or add2total:
|
||||
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 row
|
||||
else:
|
||||
row += 1
|
||||
col_labels = [
|
||||
_("Date"),
|
||||
_("Partner"),
|
||||
_("Amount"),
|
||||
_("Journal Entry"),
|
||||
_("Counter-part"),
|
||||
_("Ref."),
|
||||
_("Label"),
|
||||
]
|
||||
col = 0
|
||||
for col_label in col_labels:
|
||||
sheet.write(row, col, col_label, style['col_header'])
|
||||
col += 1
|
||||
row += 1
|
||||
start_line = row + 1
|
||||
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[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'])
|
||||
sheet.write(row, 6, mline["label"], style['regular'])
|
||||
subtotal += mline["amount"]
|
||||
row += 1
|
||||
end_line = row
|
||||
|
||||
for col in range(1):
|
||||
sheet.write(row, col, "", style[f"title{style_suffix}"])
|
||||
sheet.write(row, 1, _("Sub-total:") + ' ', style[f"title_right{style_suffix}"])
|
||||
|
||||
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'] += 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
|
||||
company = wizard.company_id
|
||||
style = self._get_style(workbook, company)
|
||||
move_state_label = dict(
|
||||
wizard.fields_get('move_state', 'selection')['move_state']['selection'])
|
||||
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': '=',
|
||||
'total_col': 'C',
|
||||
}
|
||||
sheet.write(
|
||||
row,
|
||||
0,
|
||||
_("Bank Reconciliation Report"),
|
||||
style['doc_title'],
|
||||
)
|
||||
row += 1
|
||||
sheet.write(row, 0, generated_on_label, style['small'])
|
||||
sheet.set_row(0, 26)
|
||||
sheet.set_column(0, 0, 10)
|
||||
sheet.set_column(1, 1, 35)
|
||||
sheet.set_column(2, 2, 15)
|
||||
sheet.set_column(3, 3, 15)
|
||||
sheet.set_column(4, 4, 25)
|
||||
sheet.set_column(5, 5, 30)
|
||||
sheet.set_column(6, 6, 60)
|
||||
row += 3
|
||||
sheet.write(row, 0, _("Company"), style['wizard_field'])
|
||||
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'])
|
||||
row += 1
|
||||
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
|
||||
for col in range(1):
|
||||
sheet.write(row, col, "", style['title'])
|
||||
sheet.write(row, 1, _("Balance %s:") % bank_account.code + ' ', style['title_right'])
|
||||
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[f"{jdi['currency']}_bg"])
|
||||
jdi['total'] += account_bal
|
||||
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)
|
||||
# 3) Show payment lines OUT (credit)
|
||||
credit_account = journal.payment_credit_account_id
|
||||
row = self._write_move_lines_block(jdi, row, credit_account)
|
||||
|
||||
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[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"
|
||||
light_blue = "#e0edff"
|
||||
subtotal_orange = "#ffcc00"
|
||||
subtotal_warn = "#ffff99"
|
||||
amount_manual = "#ffeeab"
|
||||
title_warn = "#ff9999"
|
||||
lang_code = self.env.user.lang
|
||||
lang = False
|
||||
if lang_code:
|
||||
lang = self.env["res.lang"].search([("code", "=", lang_code)])
|
||||
if not lang:
|
||||
lang = self.env["res.lang"].search([], limit=1)
|
||||
xls_date_format = (
|
||||
lang.date_format.replace("%Y", "yyyy")
|
||||
.replace("%m", "mm")
|
||||
.replace("%d", "dd")
|
||||
.replace("%y", "yy")
|
||||
)
|
||||
|
||||
style['doc_title'] = workbook.add_format(
|
||||
{"bold": True, "font_size": font_size + 4})
|
||||
style['small'] = workbook.add_format({"font_size": font_size - 3})
|
||||
style['col_header'] = workbook.add_format(
|
||||
{
|
||||
"bold": True,
|
||||
"bg_color": light_grey,
|
||||
"text_wrap": True,
|
||||
"font_size": font_size,
|
||||
"align": "center",
|
||||
}
|
||||
)
|
||||
title_style = {
|
||||
"bold": True,
|
||||
"bg_color": light_blue,
|
||||
"font_size": font_size,
|
||||
"align": "left",
|
||||
}
|
||||
style['title_right'] = workbook.add_format(dict(title_style, align="right"))
|
||||
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_blue,
|
||||
"bold": True,
|
||||
"font_size": font_size,
|
||||
"align": "left",
|
||||
}
|
||||
|
||||
style['wizard_value'] = workbook.add_format(wizard_value_style)
|
||||
style['wizard_value_date'] = workbook.add_format(
|
||||
dict(wizard_value_style, num_format=xls_date_format))
|
||||
style['none'] = workbook.add_format(
|
||||
{"bold": True, "font_size": font_size, "align": "right", "bg_color": subtotal_orange}
|
||||
)
|
||||
# WARN for suspense account
|
||||
style['title_warn'] = workbook.add_format(
|
||||
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, "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", "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(dict(currency_style, border=1))
|
||||
style[f'{currency}_bg'] = workbook.add_format(
|
||||
dict(currency_style, bg_color=subtotal_orange))
|
||||
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
|
||||
17
account_bank_reconciliation_summary_xlsx/report/report.xml
Normal file
17
account_bank_reconciliation_summary_xlsx/report/report.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
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).
|
||||
-->
|
||||
<odoo>
|
||||
|
||||
<record id="bank_reconciliation_xlsx" model="ir.actions.report">
|
||||
<field name="name">Bank Reconciliation XLSX</field>
|
||||
<field name="model">bank.reconciliation.report.wizard</field>
|
||||
<field name="report_type">xlsx</field>
|
||||
<field name="report_name">bank.reconciliation.xlsx</field>
|
||||
<field name="report_file">bank.reconciliation.xlsx</field>
|
||||
<field name="print_report_name">'bank_reconciliation-%s' % (object.date)</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1,3 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_bank_reconciliation_report_wizard_user,Full access on bank.reconciliation.report.wizard,model_bank_reconciliation_report_wizard,account.group_account_user,1,1,1,1
|
||||
access_bank_reconciliation_report_wizard_readonly,Full access on bank.reconciliation.report.wizard,model_bank_reconciliation_report_wizard,account.group_account_readonly,1,1,1,1
|
||||
|
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
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).
|
||||
-->
|
||||
<odoo>
|
||||
<record id="view_bank_statement_form" model="ir.ui.view">
|
||||
<field name="name">bank_rec_summary.account.bank.statement.form</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_form" />
|
||||
<field name="arch" type="xml">
|
||||
<button name="button_reprocess" position="after">
|
||||
<button
|
||||
name="%(bank_reconciliation_report_wizard_action)d"
|
||||
type="action"
|
||||
string="Bank Reconciliation Report"
|
||||
context="{'default_journal_ids': [journal_id]}"
|
||||
/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
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).
|
||||
-->
|
||||
<odoo>
|
||||
<!-- Accounting Dashboard -->
|
||||
<record id="account_journal_dashboard_kanban_view" model="ir.ui.view">
|
||||
<field
|
||||
name="name"
|
||||
>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">
|
||||
<xpath expr="//a[@name='open_collect_money']/.." position="before">
|
||||
<div name="bank_reconciliation_report">
|
||||
<a
|
||||
role="menuitem"
|
||||
type="action"
|
||||
name="%(bank_reconciliation_report_wizard_action)d"
|
||||
context="{'default_journal_ids': [active_id]}"
|
||||
>Bank Reconciliation</a>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -0,0 +1 @@
|
||||
from . import bank_reconciliation_report_wizard
|
||||
@@ -0,0 +1,42 @@
|
||||
# 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).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class BankReconciliationReportWizard(models.TransientModel):
|
||||
_name = "bank.reconciliation.report.wizard"
|
||||
_description = "Bank Reconciliation Report Wizard"
|
||||
_check_company_auto = True
|
||||
|
||||
company_id = fields.Many2one(
|
||||
'res.company', string='Company',
|
||||
ondelete='cascade', required=True,
|
||||
default=lambda self: self.env.company)
|
||||
date = fields.Date(required=True, default=fields.Date.context_today)
|
||||
move_state = fields.Selection(
|
||||
[("posted", "Posted Entries"), ("draft_posted", "Draft and Posted Entries")],
|
||||
string="Entries",
|
||||
required=True,
|
||||
default="posted",
|
||||
)
|
||||
journal_ids = fields.Many2many(
|
||||
"account.journal",
|
||||
string="Bank Journals",
|
||||
domain="[('type', '=', 'bank'), ('company_id', '=', company_id)]",
|
||||
required=True,
|
||||
check_company=True,
|
||||
default=lambda self: self._default_journal_ids(),
|
||||
)
|
||||
|
||||
@api.model
|
||||
def _default_journal_ids(self):
|
||||
journals = self.env["account.journal"].search(
|
||||
[
|
||||
("type", "=", "bank"),
|
||||
("bank_account_id", "!=", False),
|
||||
("company_id", "=", self.env.company.id),
|
||||
]
|
||||
)
|
||||
return journals
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
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).
|
||||
-->
|
||||
<odoo>
|
||||
<record id="bank_reconciliation_report_wizard_form" model="ir.ui.view">
|
||||
<field name="name">bank.reconciliation.report.wizard.form</field>
|
||||
<field name="model">bank.reconciliation.report.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<group name="main">
|
||||
<field name="company_id" invisible="1" />
|
||||
<field name="date" />
|
||||
<field name="journal_ids" widget="many2many_tags" options="{'no_open': True, 'no_create': True}"/>
|
||||
<field name="move_state" widget="radio"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button
|
||||
name="%(account_bank_reconciliation_summary_xlsx.bank_reconciliation_xlsx)d"
|
||||
string="Export XLSX"
|
||||
type="action"
|
||||
class="btn-primary"
|
||||
/>
|
||||
<button special="cancel" string="Cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="bank_reconciliation_report_wizard_action" model="ir.actions.act_window">
|
||||
<field name="name">Bank Reconciliation</field>
|
||||
<field name="res_model">bank.reconciliation.report.wizard</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_report_bank_root"
|
||||
parent="account.menu_finance_reports"
|
||||
name="Bank Reports"
|
||||
sequence="12"
|
||||
/>
|
||||
<menuitem
|
||||
id="bank_reconciliation_report_wizard_menu"
|
||||
action="bank_reconciliation_report_wizard_action"
|
||||
parent="menu_report_bank_root"
|
||||
sequence="10"
|
||||
/>
|
||||
</odoo>
|
||||
23
account_fiscal_position_payable_receivable/__manifest__.py
Normal file
23
account_fiscal_position_payable_receivable/__manifest__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# © 2016-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Account Fiscal Position Payable Receivable",
|
||||
"version": "12.0.1.0.0",
|
||||
"category": "Accounting & Finance",
|
||||
"license": "AGPL-3",
|
||||
"summary": "Configure payable/receivable accounts on fiscal positions",
|
||||
"description": """
|
||||
Account Fiscal Position Payable Receivable
|
||||
==========================================
|
||||
|
||||
This module allows to configure a special *Partner Receivable Account* and a special *Partner Payable Account* on fiscal positions. This is used in the onchange of the fiscal position of partners.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
"author": "Akretion",
|
||||
"website": "http://www.akretion.com",
|
||||
"depends": ["account"],
|
||||
"data": ["views/account_fiscal_position_view.xml"],
|
||||
"installable": False,
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
from . import account_fiscal_position
|
||||
from . import res_partner
|
||||
@@ -0,0 +1,21 @@
|
||||
# © 2016-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class AccountFiscalPosition(models.Model):
|
||||
_inherit = "account.fiscal.position"
|
||||
|
||||
receivable_account_id = fields.Many2one(
|
||||
"account.account",
|
||||
string="Partner Receivable Account",
|
||||
company_dependent=True,
|
||||
domain=[("internal_type", "=", "receivable")],
|
||||
)
|
||||
payable_account_id = fields.Many2one(
|
||||
"account.account",
|
||||
string="Partner Payable Account",
|
||||
company_dependent=True,
|
||||
domain=[("internal_type", "=", "payable")],
|
||||
)
|
||||
@@ -0,0 +1,25 @@
|
||||
# © 2016-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = "res.partner"
|
||||
|
||||
@api.onchange("property_account_position_id")
|
||||
def fiscal_position_receivable_payable_change(self):
|
||||
fp = self.property_account_position_id
|
||||
ipo = self.env["ir.property"]
|
||||
if fp.receivable_account_id:
|
||||
self.property_account_receivable_id = fp.receivable_account_id
|
||||
else:
|
||||
self.property_account_receivable_id = ipo.get(
|
||||
"property_account_receivable_id", "res.partner"
|
||||
)
|
||||
if fp.payable_account_id:
|
||||
self.property_account_payable_id = fp.payable_account_id
|
||||
else:
|
||||
self.property_account_payable_id = ipo.get(
|
||||
"property_account_payable_id", "res.partner"
|
||||
)
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="view_account_position_form" model="ir.ui.view">
|
||||
<field name="name">receivable_payable.fiscal_position_form</field>
|
||||
<field name="model">account.fiscal.position</field>
|
||||
<field name="inherit_id" ref="account.view_account_position_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="company_id" position="after">
|
||||
<field name="receivable_account_id"/>
|
||||
<field name="payable_account_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -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
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
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
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')
|
||||
55
account_invoice_margin/views/account_move.xml
Normal file
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>
|
||||
@@ -18,5 +18,5 @@
|
||||
'wizard/account_move_update_view.xml',
|
||||
'views/account_move.xml',
|
||||
],
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_invoice_update_wizard
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \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: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__price_subtotal
|
||||
msgid "Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__analytic_account_id
|
||||
msgid "Analytic Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__analytic_tag_ids
|
||||
msgid "Analytic Tags"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__partner_bank_id
|
||||
msgid "Bank Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Bill Reference"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__company_id
|
||||
msgid "Company"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__create_uid
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__create_date
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__currency_id
|
||||
msgid "Currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Customer Reference"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__name
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move__display_name
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__display_name
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__display_type
|
||||
msgid "Display Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move__id
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__id
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_id
|
||||
msgid "Invoice"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__invoice_line_id
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__line_ids
|
||||
msgid "Invoice Lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.actions.act_window,name:account_invoice_update_wizard.account_invoice_update_action
|
||||
msgid "Invoice Update Wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model,name:account_invoice_update_wizard.model_account_move
|
||||
msgid "Journal Entry"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move____last_update
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update____last_update
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__write_uid
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__write_date
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
|
||||
#, python-format
|
||||
msgid "Non-legal fields of invoice updated via the Invoice Update wizard."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields.selection,name:account_invoice_update_wizard.selection__account_move_line_update__display_type__line_note
|
||||
msgid "Note"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__partner_id
|
||||
msgid "Partner"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_payment_term_id
|
||||
msgid "Payment Term"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__quantity
|
||||
msgid "Quantity"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__ref
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__user_id
|
||||
msgid "Salesperson"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields.selection,name:account_invoice_update_wizard.selection__account_move_line_update__display_type__line_section
|
||||
msgid "Section"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__sequence
|
||||
msgid "Sequence"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_origin
|
||||
msgid "Source Document"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,help:account_invoice_update_wizard.field_account_move_line_update__display_type
|
||||
msgid "Technical field for UX purpose."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"The original payment term '%s' doesn't have the same terms (number of terms "
|
||||
"and/or amount) as the new payment term '%s'. You can only switch to a "
|
||||
"payment term that has the same number of terms with the same amount."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"This wizard doesn't support the update of payment terms on an invoice which "
|
||||
"is partially or fully paid."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__move_type
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Update"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.view_move_form_inherit
|
||||
msgid "Update Invoice"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Update Invoice Wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model,name:account_invoice_update_wizard.model_account_move_line_update
|
||||
msgid "Update non-legal fields of invoice lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__parent_id
|
||||
msgid "Wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model,name:account_invoice_update_wizard.model_account_move_update
|
||||
msgid "Wizard to update non-legal fields of invoice"
|
||||
msgstr ""
|
||||
250
account_invoice_update_wizard/i18n/fr.po
Normal file
250
account_invoice_update_wizard/i18n/fr.po
Normal file
@@ -0,0 +1,250 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_invoice_update_wizard
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__price_subtotal
|
||||
msgid "Amount"
|
||||
msgstr "Montant"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__analytic_account_id
|
||||
msgid "Analytic Account"
|
||||
msgstr "Compte Analytique"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__analytic_tag_ids
|
||||
msgid "Analytic Tags"
|
||||
msgstr "Tag Analytique"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__partner_bank_id
|
||||
msgid "Bank Account"
|
||||
msgstr "Compte Bancaire"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
#, fuzzy
|
||||
msgid "Bill Reference"
|
||||
msgstr "Reference Client"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__company_id
|
||||
msgid "Company"
|
||||
msgstr "Société"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__create_uid
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Créé par"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__create_date
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Créé le"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__currency_id
|
||||
msgid "Currency"
|
||||
msgstr "Devise"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
#, fuzzy
|
||||
msgid "Customer Reference"
|
||||
msgstr "Reference Client"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__name
|
||||
msgid "Description"
|
||||
msgstr "Description"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move__display_name
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__display_name
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nom"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__display_type
|
||||
msgid "Display Type"
|
||||
msgstr "Type Affichage"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move__id
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__id
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_id
|
||||
msgid "Invoice"
|
||||
msgstr "Facture"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__invoice_line_id
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__line_ids
|
||||
msgid "Invoice Lines"
|
||||
msgstr "Ligne de factures"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.actions.act_window,name:account_invoice_update_wizard.account_invoice_update_action
|
||||
msgid "Invoice Update Wizard"
|
||||
msgstr "Assistance de mise à jour de la facture"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model,name:account_invoice_update_wizard.model_account_move
|
||||
msgid "Journal Entry"
|
||||
msgstr "Entrée comptable"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move____last_update
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update____last_update
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__write_uid
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__write_date
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
|
||||
#, python-format
|
||||
msgid "Non-legal fields of invoice updated via the Invoice Update wizard."
|
||||
msgstr "Champs non légaux mis à jour via l'assistant"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields.selection,name:account_invoice_update_wizard.selection__account_move_line_update__display_type__line_note
|
||||
msgid "Note"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__partner_id
|
||||
msgid "Partner"
|
||||
msgstr "Client"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_payment_term_id
|
||||
msgid "Payment Term"
|
||||
msgstr "Condition de paiement"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__quantity
|
||||
msgid "Quantity"
|
||||
msgstr "Quantité"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__ref
|
||||
#, fuzzy
|
||||
msgid "Reference"
|
||||
msgstr "Reference Client"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__user_id
|
||||
msgid "Salesperson"
|
||||
msgstr "Vendeur"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields.selection,name:account_invoice_update_wizard.selection__account_move_line_update__display_type__line_section
|
||||
msgid "Section"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__sequence
|
||||
msgid "Sequence"
|
||||
msgstr "Sequence"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_origin
|
||||
msgid "Source Document"
|
||||
msgstr "Origine du document"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,help:account_invoice_update_wizard.field_account_move_line_update__display_type
|
||||
msgid "Technical field for UX purpose."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"The original payment term '%s' doesn't have the same terms (number of terms "
|
||||
"and/or amount) as the new payment term '%s'. You can only switch to a "
|
||||
"payment term that has the same number of terms with the same amount."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"This wizard doesn't support the update of payment terms on an invoice which "
|
||||
"is partially or fully paid."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__move_type
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Update"
|
||||
msgstr "Mettre à jour"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.view_move_form_inherit
|
||||
msgid "Update Invoice"
|
||||
msgstr "Mettre à jour"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Update Invoice Wizard"
|
||||
msgstr "Assistant de mise à jour"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model,name:account_invoice_update_wizard.model_account_move_line_update
|
||||
msgid "Update non-legal fields of invoice lines"
|
||||
msgstr "Mettre à jour les champs non légaux des lignes de facture"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__parent_id
|
||||
msgid "Wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model,name:account_invoice_update_wizard.model_account_move_update
|
||||
msgid "Wizard to update non-legal fields of invoice"
|
||||
msgstr "Assistant pour mettre à jours les champs non légaux"
|
||||
|
||||
#~ msgid "Account"
|
||||
#~ msgstr "Compte"
|
||||
@@ -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):
|
||||
@@ -48,6 +49,7 @@ class AccountMoveUpdate(models.TransientModel):
|
||||
aa_tags = [(6, 0, aa_tags.ids)] if aa_tags else False
|
||||
res['line_ids'].append([0, 0, {
|
||||
'invoice_line_id': line.id,
|
||||
'sequence': line.sequence,
|
||||
'name': line.name,
|
||||
'quantity': line.quantity,
|
||||
'price_subtotal': line.price_subtotal,
|
||||
@@ -225,13 +227,21 @@ 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
|
||||
|
||||
|
||||
class AccountMoveLineUpdate(models.TransientModel):
|
||||
_name = 'account.move.line.update'
|
||||
_description = 'Update non-legal fields of invoice lines'
|
||||
_order = "sequence, name"
|
||||
|
||||
sequence = fields.Integer()
|
||||
parent_id = fields.Many2one(
|
||||
'account.move.update', string='Wizard', ondelete='cascade')
|
||||
invoice_line_id = fields.Many2one(
|
||||
|
||||
@@ -15,22 +15,25 @@
|
||||
<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 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 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" 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">
|
||||
<field name="line_ids" nolabel="1" widget="section_and_note_one2many">
|
||||
<tree editable="bottom" create="false" delete="false" edit="true">
|
||||
<field name="invoice_line_id" invisible="1"/>
|
||||
<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>
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
'website': 'https://github.com/akretion/odoo-usability',
|
||||
'depends': ['account_invoice_update_wizard', 'account_payment_partner'],
|
||||
'data': ['wizard/account_move_update_view.xml'],
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
'auto_install': True,
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<field name="model">account.move.update</field>
|
||||
<field name="inherit_id" ref="account_invoice_update_wizard.account_invoice_update_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="invoice_payment_term_id" position="after">
|
||||
<field name="partner_bank_id" position="before">
|
||||
<field name="payment_mode_filter_type_domain" invisible="1"/>
|
||||
<field name="partner_bank_filter_type_domain" invisible="1"/>
|
||||
<field name="bank_account_required" invisible="1"/>
|
||||
|
||||
@@ -14,5 +14,5 @@
|
||||
'data': [
|
||||
'views/account_menu.xml',
|
||||
],
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ I don't recommend the use of this module.
|
||||
'data': [
|
||||
'views/account_move.xml',
|
||||
],
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
25
account_payment_line_manual_account/__manifest__.py
Normal file
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
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
|
||||
@@ -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>
|
||||
@@ -1 +0,0 @@
|
||||
from . import report
|
||||
@@ -1,32 +0,0 @@
|
||||
# Copyright 2023 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 Product Fiscal Classification - Sale',
|
||||
'version': '16.0.1.0.0',
|
||||
'category': 'Sales',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Glue module between account_product_fiscal_classification and sale',
|
||||
'description': """
|
||||
This module adds a **Start Date** and **End Date** field on invoice
|
||||
lines. For example, if you have an insurance contrat for your company
|
||||
that run from April 1st 2013 to March 31st 2014, you will enter these
|
||||
dates as start and end dates on the supplier invoice line. If your
|
||||
fiscal year ends on December 31st 2013, 3 months of expenses are part of
|
||||
the 2014 fiscal year and should not be part of the 2013 fiscal year. So,
|
||||
thanks to this module, you will create a *Prepaid Expense* on December
|
||||
31st 2013 and OpenERP will identify this expense with the 3 months that
|
||||
are after the cut-off date and propose to generate the appropriate
|
||||
cut-off journal entry.
|
||||
|
||||
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': ['pos_sale', 'account_product_fiscal_classification'],
|
||||
"data": ['report/sale_report_view.xml'],
|
||||
'auto_install': True,
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
# Copyright 2023 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
|
||||
|
||||
|
||||
class SaleReport(models.Model):
|
||||
_inherit = "sale.report"
|
||||
|
||||
fiscal_classification_id = fields.Many2one(
|
||||
"account.product.fiscal.classification",
|
||||
string="Product Fiscal Classification",
|
||||
readonly=True,
|
||||
)
|
||||
|
||||
def _select_additional_fields(self):
|
||||
res = super()._select_additional_fields()
|
||||
res["fiscal_classification_id"] = "t.fiscal_classification_id"
|
||||
return res
|
||||
|
||||
def _group_by_sale(self):
|
||||
res = super()._group_by_sale()
|
||||
res += ", t.fiscal_classification_id"
|
||||
return res
|
||||
|
||||
def _fill_pos_fields(self, additional_fields):
|
||||
res = super()._fill_pos_fields(additional_fields)
|
||||
res['fiscal_classification_id'] = "t.fiscal_classification_id"
|
||||
return res
|
||||
|
||||
def _group_by_pos(self):
|
||||
res = super()._group_by_pos()
|
||||
res += ", t.fiscal_classification_id"
|
||||
return res
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2023 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_order_product_search" model="ir.ui.view">
|
||||
<field name="model">sale.report</field>
|
||||
<field name="inherit_id" ref="sale.view_order_product_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="Category" position="after">
|
||||
<filter name="fiscal_classification_groupby" string="Product Fiscal Classification" context="{'group_by': 'fiscal_classification_id'}"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,39 +1,45 @@
|
||||
# Copyright 2015-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2015-2020 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).
|
||||
|
||||
{
|
||||
'name': 'Account Usability',
|
||||
'version': '16.0.1.0.0',
|
||||
'version': '14.0.1.1.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Small usability enhancements in account module',
|
||||
'author': 'Akretion',
|
||||
'website': 'https://github.com/akretion/odoo-usability',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': [
|
||||
'account',
|
||||
'base_usability', # needed only to access base_usability.group_nobody
|
||||
# in v12, I may create a module only for group_nobody
|
||||
],
|
||||
'data': [
|
||||
'views/account_account_type.xml',
|
||||
'views/account_account.xml',
|
||||
'views/account_group.xml',
|
||||
# 'views/account_bank_statement.xml',
|
||||
'views/account_analytic_account.xml',
|
||||
'views/account_analytic_group.xml',
|
||||
'views/account_bank_statement.xml',
|
||||
'views/account_invoice_report.xml',
|
||||
'views/account_journal.xml',
|
||||
'views/account_move.xml',
|
||||
'views/account_analytic_line.xml',
|
||||
'views/account_menu.xml',
|
||||
'views/account_tax.xml',
|
||||
# 'views/product.xml', # TODO
|
||||
'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',
|
||||
'wizard/account_group_generate_view.xml',
|
||||
'wizard/account_payment_register_views.xml',
|
||||
'security/ir.model.access.csv',
|
||||
# 'report/invoice_report.xml', # TODO
|
||||
'report/invoice_report.xml',
|
||||
],
|
||||
# 'qweb': ['static/src/xml/account_payment.xml'],
|
||||
'qweb': ['static/src/xml/account_payment.xml'],
|
||||
'installable': True,
|
||||
# "post_init_hook": "post_init_hook",
|
||||
"post_init_hook": "post_init_hook",
|
||||
}
|
||||
744
account_usability/i18n/fr.po
Normal file
744
account_usability/i18n/fr.po
Normal file
@@ -0,0 +1,744 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_usability
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-06-01 14:17+0000\n"
|
||||
"PO-Revision-Date: 2022-09-18 18:55+0200\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: Alpis Traduction et Interprétation <info@alpis.fr>\n"
|
||||
"Language: fr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.0.4\n"
|
||||
|
||||
#. module: account_usability
|
||||
#: code:addons/account_usability/wizard/account_group_generate.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"%d account groups already exists in company '%s'. This wizard is designed "
|
||||
"to generate account groups from scratch."
|
||||
msgstr ""
|
||||
"%d des groupes de comptes existent déjà dans la société '%s'. Cet "
|
||||
"assistant est conçu pour créer des groupes de comptes à partir de zéro."
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_account
|
||||
msgid "Account"
|
||||
msgstr "Compte"
|
||||
|
||||
#. module: account_usability
|
||||
#: code:addons/account_usability/wizard/account_group_generate.py:0
|
||||
#, python-format
|
||||
msgid "Account Groups"
|
||||
msgstr "Groupes de comptes"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_move_reversal
|
||||
msgid "Account Move Reversal"
|
||||
msgstr "Extourne d'écritures"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_reconciliation_widget
|
||||
msgid "Account Reconciliation widget"
|
||||
msgstr "Outils de lettrage de compte"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_journal__account_type_current_assets_id
|
||||
msgid "Account Type Current Assets"
|
||||
msgstr "Type de compte actif circulant"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_journal__account_type_current_liabilities_id
|
||||
msgid "Account Type Current Liabilities"
|
||||
msgstr "Type de compte Dettes à court terme"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_line__account_reconcile
|
||||
msgid "Allow Reconciliation"
|
||||
msgstr "Autoriser le lettrage"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.constraint,message:account_usability.constraint_account_analytic_account_code_company_unique
|
||||
msgid ""
|
||||
"An analytic account with the same code already exists in the same company!"
|
||||
msgstr ""
|
||||
"Un compte analytique avec le même code existe déjà dans la même société !"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_analytic_account
|
||||
msgid "Analytic Account"
|
||||
msgstr "Compte analytique"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_bank_statement_form
|
||||
msgid "Are you sure to unreconcile all the entries of the bank statement?"
|
||||
msgstr "Êtes-vous sûr de vouloir délettrer toutes les écritures du relevé ?"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_line__balance
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_move_line_tree
|
||||
msgid "Balance"
|
||||
msgstr "Solde"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,help:account_usability.field_account_bank_statement_line__partner_bank_id
|
||||
#: model:ir.model.fields,help:account_usability.field_account_move__partner_bank_id
|
||||
msgid ""
|
||||
"Bank Account Number to which the invoice will be paid. A Company bank "
|
||||
"account if this is a Customer Invoice or Vendor Credit Note, otherwise a "
|
||||
"Partner bank account number."
|
||||
msgstr ""
|
||||
"Numéro du compte bancaire sur lequel la facture sera payée. Un compte "
|
||||
"bancaire de la société s'il s'agit d'une facture client ou d'un avoir du "
|
||||
"fournisseur, sinon un numéro de compte bancaire du tiers."
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.ui.menu,name:account_usability.res_partner_bank_account_config_menu
|
||||
msgid "Bank Accounts"
|
||||
msgstr "Comptes bancaires"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_bank_statement
|
||||
msgid "Bank Statement"
|
||||
msgstr "Relevé de compte"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_bank_statement_line
|
||||
msgid "Bank Statement Line"
|
||||
msgstr "Ligne de relevé de compte"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.ui.menu,name:account_usability.res_bank_account_config_menu
|
||||
msgid "Banks"
|
||||
msgstr "Banques"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.account_group_generate_form
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.account_invoice_mark_sent_form
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,help:account_usability.field_account_move_line__account_reconcile
|
||||
msgid ""
|
||||
"Check this box if this account allows invoices & payments matching of "
|
||||
"journal items."
|
||||
msgstr ""
|
||||
"Cochez cette case si ce compte permet de faire du rapprochement entre "
|
||||
"factures et paiements."
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_search
|
||||
msgid "Code"
|
||||
msgstr "Code"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_res_company
|
||||
msgid "Companies"
|
||||
msgstr "Sociétés"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_res_config_settings
|
||||
msgid "Config Settings"
|
||||
msgstr "Paramètres de configuration"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_res_partner
|
||||
msgid "Contact"
|
||||
msgstr "Contact"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_group_generate__create_uid
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_invoice_mark_sent__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Créé par"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_group_generate__create_date
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_invoice_mark_sent__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Créé le"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,help:account_usability.field_account_move_line__matched_credit_ids
|
||||
msgid "Credit journal items that are matched with this journal item."
|
||||
msgstr "Écritures comptables au crédit qui correspondent à cette écriture comptable."
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_move_line_filter
|
||||
msgid "Current Year"
|
||||
msgstr "Année en cours"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__date
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__date
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_payment__date
|
||||
msgid "Date"
|
||||
msgstr "Date"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,help:account_usability.field_account_move_line__matched_debit_ids
|
||||
msgid "Debit journal items that are matched with this journal item."
|
||||
msgstr "Écritures comptables au débit qui correspondent avec cette écriture comptable."
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_move_line_filter
|
||||
msgid "Debit or Credit"
|
||||
msgstr "Débit ou crédit"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_account__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_analytic_account__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_group_generate__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_incoterms__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_invoice_mark_sent__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_invoice_report__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_journal__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_line__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_reversal__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_partial_reconcile__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_product_supplierinfo__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_product_template__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_company__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_config_settings__display_name
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_partner__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nom affiché"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__invoice_date_due
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__invoice_date_due
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_payment__invoice_date_due
|
||||
msgid "Due Date"
|
||||
msgstr "Date d'échéance"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement__end_date
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_bank_statement_search
|
||||
msgid "End Date"
|
||||
msgstr "Date de Fin"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_fiscal_position
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__fiscal_position_id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__fiscal_position_id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_payment__fiscal_position_id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_partner__property_account_position_id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_users__property_account_position_id
|
||||
msgid "Fiscal Position"
|
||||
msgstr "Position fiscale"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_fiscalyear
|
||||
msgid "Fiscal Year"
|
||||
msgstr "Exercice"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,help:account_usability.field_account_bank_statement_line__fiscal_position_id
|
||||
#: model:ir.model.fields,help:account_usability.field_account_move__fiscal_position_id
|
||||
#: model:ir.model.fields,help:account_usability.field_account_payment__fiscal_position_id
|
||||
msgid ""
|
||||
"Fiscal positions are used to adapt taxes and accounts for particular "
|
||||
"customers or sales orders/invoices. The default value comes from the "
|
||||
"customer."
|
||||
msgstr ""
|
||||
"Les positions fiscales sont utilisées pour adapter les taxes et les comptes "
|
||||
"à des clients particuliers ou à des bons de commande/factures. La valeur "
|
||||
"par défaut provient du client."
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_line__full_reconcile_id
|
||||
msgid "Full Reconcile"
|
||||
msgstr "Marque de lettrage"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_move_line_filter
|
||||
msgid "Fully Reconciled"
|
||||
msgstr "Lettré totalement"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.account_group_generate_form
|
||||
msgid "Generate"
|
||||
msgstr "Générer"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.actions.act_window,name:account_usability.account_group_generate_action
|
||||
#: model:ir.model,name:account_usability.model_account_group_generate
|
||||
#: model:ir.ui.menu,name:account_usability.account_group_generate_menu
|
||||
msgid "Generate Account Groups"
|
||||
msgstr "Générer les groupes de comptes"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_analytic_account_search
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_search
|
||||
msgid "Group"
|
||||
msgstr "Groupe"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_journal_search
|
||||
msgid "Group By"
|
||||
msgstr "Regrouper par"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__has_attachment
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__has_attachment
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_payment__has_attachment
|
||||
msgid "Has Attachment"
|
||||
msgstr "Possède une pièce jointe"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__has_discount
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__has_discount
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_payment__has_discount
|
||||
msgid "Has Discount"
|
||||
msgstr "A une réduction"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement__hide_bank_statement_balance
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_journal__hide_bank_statement_balance
|
||||
msgid "Hide Bank Statement Balance"
|
||||
msgstr "Masquer le solde du relevé bancaire"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_account__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_analytic_account__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_group_generate__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_incoterms__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_invoice_mark_sent__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_invoice_report__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_journal__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_line__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_reversal__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_partial_reconcile__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_product_supplierinfo__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_product_template__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_company__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_config_settings__id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_partner__id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_incoterms
|
||||
msgid "Incoterms"
|
||||
msgstr "Incoterms"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_config_settings__transfer_account_id
|
||||
msgid "Inter-Banks Transfer Account"
|
||||
msgstr "Compte de transfert inter-bancaire"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,help:account_usability.field_res_config_settings__transfer_account_id
|
||||
msgid ""
|
||||
"Intermediary account used when moving money from a liquidity account to "
|
||||
"another"
|
||||
msgstr ""
|
||||
"Compte intermédiaire utilisé pour déplacer de l'argent d'un compte de "
|
||||
"trésorerie vers un autre"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,help:account_usability.field_account_move_line__product_barcode
|
||||
msgid "International Article Number used for product identification."
|
||||
msgstr ""
|
||||
"Numéro d'article international (IAN) utilisé pour identifier cet article."
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_invoice
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_partner__invoice_warn
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_users__invoice_warn
|
||||
msgid "Invoice"
|
||||
msgstr "Facture"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_company_form
|
||||
msgid "Invoice Legal Terms"
|
||||
msgstr "Mentions légales sur les factures"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_invoice_line
|
||||
msgid "Invoice Line"
|
||||
msgstr "Lignes de facture"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.account_invoice_report_tree
|
||||
msgid "Invoices Analysis"
|
||||
msgstr "Analyse des factures"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_invoice_report
|
||||
msgid "Invoices Statistics"
|
||||
msgstr "Statistiques des factures"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_journal
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__journal_id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__journal_id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_payment__journal_id
|
||||
msgid "Journal"
|
||||
msgstr "Journal"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_move
|
||||
msgid "Journal Entry"
|
||||
msgstr "Pièce comptable"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_move_line
|
||||
msgid "Journal Item"
|
||||
msgstr "Écriture comptable"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_account____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_analytic_account____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_group_generate____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_incoterms____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_invoice_mark_sent____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_invoice_report____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_journal____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_line____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_reversal____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_partial_reconcile____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_product_supplierinfo____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_product_template____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_company____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_config_settings____last_update
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_partner____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Dernière modification le"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_group_generate__write_uid
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_invoice_mark_sent__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Mis à jour par"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_group_generate__write_date
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_invoice_mark_sent__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Mis à jour le"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_company_form
|
||||
msgid "Legal Terms"
|
||||
msgstr "Mentions légales"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_res_company__static_invoice_terms
|
||||
msgid "Legal Terms on Invoice"
|
||||
msgstr "Mentions légales sur les factures"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_group_generate__level
|
||||
msgid "Level"
|
||||
msgstr "Niveau"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.actions.act_window,name:account_usability.account_invoice_mark_sent_action
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.account_invoice_mark_sent_form
|
||||
msgid "Mark as Sent"
|
||||
msgstr "Marquer comme envoyé"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_invoice_mark_sent
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.account_invoice_mark_sent_form
|
||||
msgid "Mark invoices as sent"
|
||||
msgstr "Marquer les factures comme envoyées"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_invoice_filter
|
||||
msgid "Missing Attachment"
|
||||
msgstr "Pièce jointe manquante"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_partial_reconcile
|
||||
msgid "Partial Reconcile"
|
||||
msgstr "Lettrage partiel"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_line__matched_credit_ids
|
||||
msgid "Partial Reconcile Credit"
|
||||
msgstr "Crédit de lettrage partiel"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_line__matched_debit_ids
|
||||
msgid "Partial Reconcile Debit"
|
||||
msgstr "Débit de lettrage partiel"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_invoice_report__industry_id
|
||||
msgid "Partner Industry"
|
||||
msgstr "Secteur d’activité du partenaire"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__invoice_payment_term_id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__invoice_payment_term_id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_payment__invoice_payment_term_id
|
||||
msgid "Payment Terms"
|
||||
msgstr "Conditions de paiement"
|
||||
|
||||
#. module: account_usability
|
||||
#: code:addons/account_usability/models/account_move.py:0
|
||||
#, python-format
|
||||
msgid "Please post the following entries before reconciliation :"
|
||||
msgstr "Veuillez comptabiliser les pièces suivantes avant le lettrage :"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_group_generate__name_prefix
|
||||
msgid "Prefix"
|
||||
msgstr "Préfixe"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_account_reconcile_model
|
||||
msgid ""
|
||||
"Preset to create journal entries during a invoices and payments matching"
|
||||
msgstr ""
|
||||
"Préconfigurer pour créer une écriture pendant la correspondance entre des "
|
||||
"factures et des paiements"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_move_line_filter
|
||||
msgid "Previous Year"
|
||||
msgstr "Année précédente"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_move_form
|
||||
msgid "Print"
|
||||
msgstr "Imprimer"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_line__product_barcode
|
||||
msgid "Product Barcode"
|
||||
msgstr "Code barre du produit"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_product_template
|
||||
msgid "Product Template"
|
||||
msgstr "Modèle de produit"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_product_product__purchase_price_type
|
||||
#: model:ir.model.fields,field_description:account_usability.field_product_supplierinfo__purchase_price_type
|
||||
#: model:ir.model.fields,field_description:account_usability.field_product_template__purchase_price_type
|
||||
msgid "Purchase Price Type"
|
||||
msgstr "Type de prix d’achat"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__partner_bank_id
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__partner_bank_id
|
||||
msgid "Recipient Bank"
|
||||
msgstr "Compte bancaire destinataire"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_line__reconcile_string
|
||||
msgid "Reconcile"
|
||||
msgstr "Lettrer"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__ref
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__ref
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_payment__ref
|
||||
msgid "Reference"
|
||||
msgstr "Référence"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move_reversal__date
|
||||
msgid "Reversal date"
|
||||
msgstr "Date d'extourne"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__sale_dates
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__sale_dates
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_payment__sale_dates
|
||||
msgid "Sale Dates"
|
||||
msgstr "Dates de vente"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_product_product__sale_price_type
|
||||
#: model:ir.model.fields,field_description:account_usability.field_product_template__sale_price_type
|
||||
msgid "Sale Price Type"
|
||||
msgstr "Type de prix de vente"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,help:account_usability.field_res_partner__invoice_warn
|
||||
#: model:ir.model.fields,help:account_usability.field_res_users__invoice_warn
|
||||
msgid ""
|
||||
"Selecting the \"Warning\" option will notify user with the message, "
|
||||
"Selecting \"Blocking Message\" will throw an exception with the message and "
|
||||
"block the flow. The Message has to be written in the next field."
|
||||
msgstr ""
|
||||
"Sélectionner l'option 'Avertissement' notifiera l'utilisateur avec le "
|
||||
"Message. Sélectionner 'Message Bloquant' lancera une exception avec le "
|
||||
"message et bloquera le flux. Le Message doit être encodé dans le champ "
|
||||
"suivant."
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_invoice_filter
|
||||
msgid "Sent"
|
||||
msgstr "Envoyé"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement__start_date
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_bank_statement_search
|
||||
msgid "Start Date"
|
||||
msgstr "Date de Début"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model,name:account_usability.model_product_supplierinfo
|
||||
msgid "Supplier Pricelist"
|
||||
msgstr "Liste prix fournisseur"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.product_supplierinfo_tree_view
|
||||
msgid "Tax"
|
||||
msgstr "Taxe"
|
||||
|
||||
#. module: account_usability
|
||||
#: code:addons/account_usability/models/product.py:0
|
||||
#, python-format
|
||||
msgid "Tax excl."
|
||||
msgstr "HT"
|
||||
|
||||
#. module: account_usability
|
||||
#: code:addons/account_usability/models/product.py:0
|
||||
#, python-format
|
||||
msgid "Tax incl."
|
||||
msgstr "TTC"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,help:account_usability.field_account_move_line__balance
|
||||
msgid ""
|
||||
"Technical field holding the debit - credit in order to open meaningful "
|
||||
"graph views from reports"
|
||||
msgstr ""
|
||||
"Champ technique égal à 'débit - crédit', utilisé pour les vues graphes dans "
|
||||
"les rapports"
|
||||
|
||||
#. module: account_usability
|
||||
#: code:addons/account_usability/wizard/account_group_generate.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"The code of account '%s' is %d caracters. It cannot be inferior to level "
|
||||
"(%d)."
|
||||
msgstr ""
|
||||
"Le code du compte '%s' fait %d caractères. Il ne peut pas être de niveau "
|
||||
"inférieur à (%d)."
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,help:account_usability.field_res_partner__property_account_position_id
|
||||
#: model:ir.model.fields,help:account_usability.field_res_users__property_account_position_id
|
||||
msgid ""
|
||||
"The fiscal position determines the taxes/accounts used for this contact."
|
||||
msgstr ""
|
||||
"La position fiscale détermine les taxes / comptes utilisés pour ce contact."
|
||||
|
||||
#. module: account_usability
|
||||
#: code:addons/account_usability/wizard/account_group_generate.py:0
|
||||
#, python-format
|
||||
msgid "The level must be >= 1."
|
||||
msgstr "Le niveau doit être >= 1."
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,help:account_usability.field_account_bank_statement_line__sale_dates
|
||||
#: model:ir.model.fields,help:account_usability.field_account_move__sale_dates
|
||||
#: model:ir.model.fields,help:account_usability.field_account_payment__sale_dates
|
||||
msgid ""
|
||||
"This information appear on invoice qweb report (you may use it for your "
|
||||
"own report)"
|
||||
msgstr ""
|
||||
"Cette information apparait sur le rapport qweb de la facture (vous "
|
||||
"pouvez les utiliser pour votre propre rapport)"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.account_group_generate_form
|
||||
msgid ""
|
||||
"This wizard is designed to auto-generate account groups from the chart of "
|
||||
"account."
|
||||
msgstr ""
|
||||
"Cet assistant est conçu pour générer automatiquement les groupes de comptes "
|
||||
"à partir du plan comptable."
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.account_invoice_mark_sent_form
|
||||
msgid ""
|
||||
"This wizard will mark as <i>sent</i> all the selected posted invoices."
|
||||
msgstr ""
|
||||
"Cet assistant marquera comme <i>envoyées</i> toutes les factures "
|
||||
"sélectionnées et comptabilisées."
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_invoice_filter
|
||||
msgid "To Send"
|
||||
msgstr "À envoyer"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_bank_statement_line__amount_total
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_move__amount_total
|
||||
#: model:ir.model.fields,field_description:account_usability.field_account_payment__amount_total
|
||||
msgid "Total"
|
||||
msgstr "Total"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.res_config_settings_view_form
|
||||
msgid ""
|
||||
"Transit account when you transfer money from a bank account of your company "
|
||||
"to another bank account of your company."
|
||||
msgstr ""
|
||||
"Compte de transit lorsque vous transférez de l'argent d'un compte bancaire "
|
||||
"de votre entreprise vers un autre compte bancaire de votre entreprise."
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_journal_search
|
||||
msgid "Type"
|
||||
msgstr "Type"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_bank_statement_form
|
||||
msgid "Unreconcile All"
|
||||
msgstr "Tout délettrer"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_account_move_line_filter
|
||||
msgid "Unreconciled or Partially Reconciled"
|
||||
msgstr "Non lettré ou partiellement lettré"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_bank_statement_form
|
||||
msgid "View Journal Entry"
|
||||
msgstr "Voir la pièce comptable"
|
||||
|
||||
#. module: account_usability
|
||||
#: model_terms:ir.ui.view,arch_db:account_usability.view_move_line_tree
|
||||
msgid "View Journal Entry Form"
|
||||
msgstr "Voir la pièce comptable en vue formulaire"
|
||||
|
||||
#. module: account_usability
|
||||
#: model:ir.model.fields,help:account_usability.field_account_bank_statement__hide_bank_statement_balance
|
||||
#: model:ir.model.fields,help:account_usability.field_account_journal__hide_bank_statement_balance
|
||||
msgid ""
|
||||
"You may want to enable this option when your bank journal is generated from "
|
||||
"a bank statement file that doesn't handle start/end balance (QIF for "
|
||||
"instance) and you don't want to enter the start/end balance manually: it "
|
||||
"will prevent the display of wrong information in the accounting dashboard "
|
||||
"and on bank statements."
|
||||
msgstr ""
|
||||
"Vous pouvez activer cette option lorsque votre journal bancaire est généré "
|
||||
"à partir d'un fichier de relevés bancaires qui ne gère pas le solde de "
|
||||
"début/fin (par exemple QIF) et que vous ne souhaitez pas saisir le solde de "
|
||||
"début/fin manuellement : cela empêchera l'affichage d'informations erronées "
|
||||
"dans le tableau de bord comptable et sur les relevés bancaires."
|
||||
@@ -1,11 +1,11 @@
|
||||
from . import account_account
|
||||
from . import account_analytic_account
|
||||
#from . import account_bank_statement
|
||||
from . import account_bank_statement
|
||||
from . import account_incoterms
|
||||
from . import account_journal
|
||||
from . import account_move
|
||||
from . import account_partial_reconcile
|
||||
from . import res_partner
|
||||
from . import res_company
|
||||
#from . import product
|
||||
from . import product
|
||||
from . import account_invoice_report
|
||||
59
account_usability/models/account_account.py
Normal file
59
account_usability/models/account_account.py
Normal file
@@ -0,0 +1,59 @@
|
||||
# Copyright 2015-2020 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).
|
||||
|
||||
from odoo import api, models
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AccountAccount(models.Model):
|
||||
_inherit = 'account.account'
|
||||
|
||||
@api.depends('name', 'code')
|
||||
def name_get(self):
|
||||
if self._context.get('account_account_show_code_only'):
|
||||
res = []
|
||||
for record in self:
|
||||
res.append((record.id, record.code))
|
||||
return res
|
||||
else:
|
||||
return super().name_get()
|
||||
|
||||
# https://github.com/odoo/odoo/issues/23040
|
||||
# TODO mig to v14 ?
|
||||
def fix_bank_account_types(self):
|
||||
aao = self.env['account.account']
|
||||
companies = self.env['res.company'].search([])
|
||||
if len(companies) > 1:
|
||||
self = self.sudo()
|
||||
logger.info("START the script 'fix bank and cash account types'")
|
||||
bank_type = self.env.ref('account.data_account_type_liquidity')
|
||||
asset_type = self.env.ref('account.data_account_type_current_assets')
|
||||
journals = self.env['account.journal'].search(
|
||||
[('type', 'in', ('bank', 'cash'))], order='company_id')
|
||||
journal_accounts_bank_type = aao
|
||||
for journal in journals:
|
||||
for account in [
|
||||
journal.default_credit_account_id,
|
||||
journal.default_debit_account_id]:
|
||||
if account:
|
||||
if account.user_type_id != bank_type:
|
||||
account.user_type_id = bank_type.id
|
||||
logger.info(
|
||||
'Company %s: Account %s updated to Bank '
|
||||
'and Cash type',
|
||||
account.company_id.display_name, account.code)
|
||||
if account not in journal_accounts_bank_type:
|
||||
journal_accounts_bank_type += account
|
||||
accounts = aao.search([
|
||||
('user_type_id', '=', bank_type.id)], order='company_id, code')
|
||||
for account in accounts:
|
||||
if account not in journal_accounts_bank_type:
|
||||
account.user_type_id = asset_type.id
|
||||
logger.info(
|
||||
'Company %s: Account %s updated to Current Asset type',
|
||||
account.company_id.display_name, account.code)
|
||||
logger.info("END of the script 'fix bank and cash account types'")
|
||||
return True
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2015-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2015-2020 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).
|
||||
|
||||
@@ -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()
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2015-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2015-2020 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).
|
||||
|
||||
@@ -8,11 +8,6 @@ from odoo import api, models
|
||||
class AccountIncoterms(models.Model):
|
||||
_inherit = 'account.incoterms'
|
||||
|
||||
_sql_constraints = [(
|
||||
'code_unique',
|
||||
'unique(code)',
|
||||
'This incoterm code already exists.')]
|
||||
|
||||
@api.depends('code', 'name')
|
||||
def name_get(self):
|
||||
res = []
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2015-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2015-2020 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).
|
||||
|
||||
@@ -19,9 +19,14 @@ class AccountJournal(models.Model):
|
||||
"(the 2 processes are managed separately)."
|
||||
)
|
||||
# Used to set default user_type_id on account fields via context
|
||||
# account_type_current_assets_id = fields.Many2one(
|
||||
# 'account.account.type',
|
||||
# default=lambda self: self.env.ref('account.data_account_type_current_assets').id)
|
||||
account_type_current_assets_id = fields.Many2one(
|
||||
'account.account.type',
|
||||
default=lambda self: self.env.ref('account.data_account_type_current_assets').id)
|
||||
|
||||
# SQL constraint in the 'account' module: unique(code, name, company_id) !!!
|
||||
_sql_constraints = [(
|
||||
'code_unique', 'unique(code, company_id)',
|
||||
'Another journal already has this code in this company!')]
|
||||
|
||||
@api.depends(
|
||||
'name', 'currency_id', 'company_id', 'company_id.currency_id', 'code')
|
||||
@@ -56,3 +61,27 @@ class AccountJournal(models.Model):
|
||||
'search_default_posted': True,
|
||||
}
|
||||
return action
|
||||
|
||||
# @api.constrains('default_credit_account_id', 'default_debit_account_id')
|
||||
# def _check_account_type_on_bank_journal(self):
|
||||
# bank_acc_type = self.env.ref('account.data_account_type_liquidity')
|
||||
# for jrl in self:
|
||||
# if jrl.type in ('bank', 'cash'):
|
||||
# if (
|
||||
# jrl.default_debit_account_id and
|
||||
# jrl.default_debit_account_id.user_type_id !=
|
||||
# bank_acc_type):
|
||||
# raise ValidationError(_(
|
||||
# "On journal '%s', the default debit account '%s' "
|
||||
# "should be configured with Type = 'Bank and Cash'.")
|
||||
# % (jrl.display_name,
|
||||
# jrl.default_debit_account_id.display_name))
|
||||
# if (
|
||||
# jrl.default_credit_account_id and
|
||||
# jrl.default_credit_account_id.user_type_id !=
|
||||
# bank_acc_type):
|
||||
# raise ValidationError(_(
|
||||
# "On journal '%s', the default credit account '%s' "
|
||||
# "should be configured with Type = 'Bank and Cash'.")
|
||||
# % (jrl.display_name,
|
||||
# jrl.default_credit_account_id.display_name))
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2015-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2015-2020 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).
|
||||
|
||||
@@ -6,10 +6,12 @@ from datetime import timedelta
|
||||
import logging
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import UserError
|
||||
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__)
|
||||
|
||||
@@ -20,23 +22,27 @@ class AccountMove(models.Model):
|
||||
# By default, we can still modify "ref" when account move is posted
|
||||
# which seems a bit lazy for me...
|
||||
ref = fields.Char(states={'posted': [('readonly', True)]})
|
||||
date = fields.Date(tracking=True)
|
||||
invoice_date_due = fields.Date(tracking=True)
|
||||
invoice_payment_term_id = fields.Many2one(tracking=True)
|
||||
journal_id = fields.Many2one(tracking=True)
|
||||
partner_bank_id = fields.Many2one(tracking=True)
|
||||
fiscal_position_id = fields.Many2one(tracking=True)
|
||||
amount_total = fields.Monetary(tracking=True)
|
||||
# for invoice report
|
||||
has_discount = fields.Boolean(compute='_compute_has_discount')
|
||||
has_discount = fields.Boolean(
|
||||
compute='_compute_has_discount', readonly=True)
|
||||
# has_attachment is useful for those who use attachment to archive
|
||||
# supplier invoices. It allows them to find supplier invoices
|
||||
# that don't have any attachment
|
||||
has_attachment = fields.Boolean(
|
||||
compute='_compute_has_attachment', search='_search_has_attachment')
|
||||
compute='_compute_has_attachment',
|
||||
search='_search_has_attachment', readonly=True)
|
||||
sale_dates = fields.Char(
|
||||
compute="_compute_sales_dates",
|
||||
compute="_compute_sales_dates", readonly=True,
|
||||
help="This information appear on invoice qweb report "
|
||||
"(you may use it for your own report)")
|
||||
# There is a native "blocked" field (bool) on account.move.line
|
||||
# There is a native "blocked" field (bool) on account.move.line
|
||||
# We want to have that field on invoices to improve usability
|
||||
# while keeping compatibility with the standard Odoo datamodel
|
||||
blocked = fields.Boolean(
|
||||
@@ -46,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):
|
||||
@@ -54,14 +93,14 @@ class AccountMove(models.Model):
|
||||
[
|
||||
l.blocked
|
||||
for l in move.line_ids
|
||||
if l.account_id.account_type in ("liability_payable", "asset_receivable")
|
||||
if l.account_id.internal_type in ("payable", "receivable")
|
||||
]
|
||||
)
|
||||
|
||||
def _inverse_blocked(self):
|
||||
for move in self:
|
||||
for line in move.line_ids.filtered(
|
||||
lambda l: l.account_id.account_type in ("liability_payable", "asset_receivable")
|
||||
lambda l: l.account_id.internal_type in ("payable", "receivable")
|
||||
):
|
||||
line.blocked = move.blocked
|
||||
|
||||
@@ -70,7 +109,7 @@ class AccountMove(models.Model):
|
||||
for inv in self:
|
||||
has_discount = False
|
||||
for line in inv.invoice_line_ids:
|
||||
if line.display_type == 'product' and not float_is_zero(line.discount, precision_digits=prec):
|
||||
if not line.display_type and not float_is_zero(line.discount, precision_digits=prec):
|
||||
has_discount = True
|
||||
break
|
||||
inv.has_discount = has_discount
|
||||
@@ -118,6 +157,24 @@ class AccountMove(models.Model):
|
||||
res.append((old_re[0], name))
|
||||
return res
|
||||
|
||||
# I really hate to see a "/" in the 'name' field of the account.move.line
|
||||
# generated from customer invoices linked to the partners' account because:
|
||||
# 1) the label of an account move line is an important field, we can't
|
||||
# write a rubbish '/' in it !
|
||||
# 2) the 'name' field of the account.move.line is used in the overdue
|
||||
# letter, and '/' is not meaningful for our customer !
|
||||
# TODO mig to v12
|
||||
# def action_move_create(self):
|
||||
# res = super().action_move_create()
|
||||
# for inv in self:
|
||||
# self._cr.execute(
|
||||
# "UPDATE account_move_line SET name= "
|
||||
# "CASE WHEN name='/' THEN %s "
|
||||
# "ELSE %s||' - '||name END "
|
||||
# "WHERE move_id=%s", (inv.number, inv.number, inv.move_id.id))
|
||||
# self.invalidate_cache()
|
||||
# return res
|
||||
|
||||
def _reverse_moves(self, default_values_list=None, cancel=False):
|
||||
reverse_moves = super()._reverse_moves(
|
||||
default_values_list=default_values_list, cancel=cancel)
|
||||
@@ -130,7 +187,7 @@ class AccountMove(models.Model):
|
||||
|
||||
def delete_lines_qty_zero(self):
|
||||
lines = self.env['account.move.line'].search([
|
||||
('display_type', '=', 'product'),
|
||||
('display_type', '=', False),
|
||||
('move_id', 'in', self.ids),
|
||||
('quantity', '=', 0)])
|
||||
lines.unlink()
|
||||
@@ -146,7 +203,7 @@ class AccountMove(models.Model):
|
||||
# Warning: the order of invoice line is forced in the view
|
||||
# <tree editable="bottom" default_order="sequence, date desc, move_name desc, id"
|
||||
# it's not the same as the _order in the class AccountMoveLine
|
||||
lines = self.env['account.move.line'].search([('display_type', 'in', ('product', 'line_section', 'line_note')), ('move_id', '=', self.id)], order="sequence, date desc, move_name desc, id")
|
||||
lines = self.env['account.move.line'].search([('exclude_from_invoice_tab', '=', False), ('move_id', '=', self.id)], order="sequence, date desc, move_name desc, id")
|
||||
for line in lines:
|
||||
if line.display_type == 'line_section':
|
||||
# insert line
|
||||
@@ -155,7 +212,7 @@ class AccountMove(models.Model):
|
||||
subtotal = 0.0 # reset counter
|
||||
has_sections = True
|
||||
else:
|
||||
if line.display_type == 'product':
|
||||
if not line.display_type:
|
||||
subtotal += line.price_subtotal * sign
|
||||
res.append({'line': line})
|
||||
if has_sections: # insert last subtotal line
|
||||
@@ -163,8 +220,8 @@ class AccountMove(models.Model):
|
||||
# res:
|
||||
# [
|
||||
# {'line': account_invoice_line(1) with display_type=='line_section'},
|
||||
# {'line': account_invoice_line(2) with display_type=='product'},
|
||||
# {'line': account_invoice_line(3) with display_type=='product'},
|
||||
# {'line': account_invoice_line(2) without display_type},
|
||||
# {'line': account_invoice_line(3) without display_type},
|
||||
# {'line': account_invoice_line(4) with display_type=='line_note'},
|
||||
# {'subtotal': 8932.23},
|
||||
# ]
|
||||
@@ -201,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 move in self.filtered(lambda x: x.move_type in ('out_invoice', 'out_refund')):
|
||||
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
|
||||
@@ -241,6 +279,40 @@ class AccountMove(models.Model):
|
||||
date = invoice_date
|
||||
return date
|
||||
|
||||
# I don't use account_invoice_supplier_ref_unique because it adds
|
||||
# a field supplier_invoice_number on account.move instead of using the native field
|
||||
# cf https://github.com/OCA/account-invoicing/issues/1484
|
||||
# So I take inspiration from the code of account_invoice_supplier_ref_unique
|
||||
# but I use the native "ref" field
|
||||
@api.constrains("ref", "partner_id")
|
||||
def _check_in_invoice_ref_unique_insensitive(self):
|
||||
for move in self:
|
||||
if move.ref and move.is_purchase_document(
|
||||
include_receipts=True
|
||||
):
|
||||
in_invoice_same_ref = self.search(
|
||||
[
|
||||
("commercial_partner_id", "=", move.commercial_partner_id.id),
|
||||
("move_type", "in", ("in_invoice", "in_refund")),
|
||||
("company_id", "=", move.company_id.id),
|
||||
("ref", "=ilike", move.ref),
|
||||
("id", "!=", move.id),
|
||||
],
|
||||
limit=1,
|
||||
)
|
||||
if in_invoice_same_ref:
|
||||
raise ValidationError(
|
||||
_(
|
||||
"An invoice already exists in Odoo with the same "
|
||||
"bill reference '%s' for the same supplier '%s': %s."
|
||||
)
|
||||
% (
|
||||
in_invoice_same_ref.ref,
|
||||
in_invoice_same_ref.partner_id.display_name,
|
||||
in_invoice_same_ref.display_name,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class AccountMoveLine(models.Model):
|
||||
_inherit = 'account.move.line'
|
||||
@@ -278,18 +350,18 @@ class AccountMoveLine(models.Model):
|
||||
_logger.info(f"Update partial reconcile number for {len(records)} lines")
|
||||
records._compute_matching_number()
|
||||
|
||||
# def _compute_matching_number(self):
|
||||
def _compute_matching_number(self):
|
||||
# TODO maybe it will be better to have the same maching_number for
|
||||
# all partial so it will be easier to group by
|
||||
# super()._compute_matching_number()
|
||||
# for record in self:
|
||||
# if record.matching_number == "P":
|
||||
# record.matching_number = ", ".join([
|
||||
# "a%d" % pr.id
|
||||
# for pr in record.matched_debit_ids + record.matched_credit_ids
|
||||
# ])
|
||||
super()._compute_matching_number()
|
||||
for record in self:
|
||||
if record.matching_number == "P":
|
||||
record.matching_number = ", ".join([
|
||||
"a%d" % pr.id
|
||||
for pr in record.matched_debit_ids + record.matched_credit_ids
|
||||
])
|
||||
|
||||
def _compute_name(self):
|
||||
def _get_computed_name(self):
|
||||
# This is useful when you want to have the product code in a dedicated
|
||||
# column in your customer invoice report
|
||||
# The same ir.config_parameter is used in sale_usability,
|
||||
@@ -298,7 +370,7 @@ class AccountMoveLine(models.Model):
|
||||
'usability.line_name_no_product_code')
|
||||
if no_product_code_param and no_product_code_param == 'True':
|
||||
self = self.with_context(display_default_code=False)
|
||||
return super()._compute_name()
|
||||
return super()._get_computed_name()
|
||||
|
||||
def reconcile(self):
|
||||
"""Explicit error message if unposted lines"""
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2015-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2015-2020 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).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2022 Akretion France (https://akretion.com/)
|
||||
# Copyright 2017-2020 Akretion France (https://akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2022 Akretion France (http://www.akretion.com/)
|
||||
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).
|
||||
-->
|
||||
@@ -14,19 +14,22 @@
|
||||
<field name="inherit_id" ref="account.view_account_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="deprecated" position="before">
|
||||
<field name="reconcile" attrs="{'invisible': ['|', ('account_type', 'in', ('asset_cash', 'liability_credit_card')), ('internal_group', '=', 'off_balance')]}" widget="boolean_toggle"/>
|
||||
<field name="reconcile" attrs="{'invisible': ['|', ('internal_type','=','liquidity'), ('internal_group', '=', 'off_balance')]}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<record id="view_account_search" model="ir.ui.view">
|
||||
<field name="name">account.account.search</field>
|
||||
<field name="model">account.account</field>
|
||||
<field name="inherit_id" ref="account.view_account_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- The native "name" filter uses a domain ['|', ('name','ilike',self), ('code','=like',str(self)+'%')]
|
||||
This is good because it uses '=like' on 'code', but sometimes there are digits in account names,
|
||||
so you get additionnal unexpected accounts in the result of the search -->
|
||||
<field name="name" position="after">
|
||||
<field name="code" filter_domain="[('code', '=like', self + '%')]" string="Code"/>
|
||||
<field name="code" filter_domain="[('code', '=like', str(self)+'%')]" string="Code"/>
|
||||
</field>
|
||||
<filter name="accounttype" position="after">
|
||||
<filter name="group_groupby" string="Group" context="{'group_by': 'group_id'}"/>
|
||||
21
account_usability/views/account_account_type.xml
Normal file
21
account_usability/views/account_account_type.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2020 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_account_type_tree" model="ir.ui.view">
|
||||
<field name="name">account_usability.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="include_initial_balance" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
33
account_usability/views/account_analytic_account.xml
Normal file
33
account_usability/views/account_analytic_account.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
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).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="view_account_analytic_account_list" model="ir.ui.view">
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="inherit_id" ref="analytic.view_account_analytic_account_list"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="code" position="after">
|
||||
<field name="group_id" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_account_analytic_account_search" model="ir.ui.view">
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="inherit_id" ref="analytic.view_account_analytic_account_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="associatedpartner" position="before">
|
||||
<filter name="group_groupby" string="Group" context="{'group_by': 'group_id'}"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
22
account_usability/views/account_analytic_group.xml
Normal file
22
account_usability/views/account_analytic_group.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 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).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="account_analytic_group_tree_view" model="ir.ui.view">
|
||||
<field name="model">account.analytic.group</field>
|
||||
<field name="inherit_id" ref="analytic.account_analytic_group_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="parent_id" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -13,13 +13,8 @@
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<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 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>
|
||||
<xpath expr="//field[@name='line_ids']/tree/button[@name='button_undo_reconciliation']" position="after">
|
||||
<field name="move_id" invisible="1"/>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2021-2022 Akretion France (http://www.akretion.com/)
|
||||
Copyright 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).
|
||||
-->
|
||||
63
account_usability/views/account_invoice_report.xml
Normal file
63
account_usability/views/account_invoice_report.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2018-2020 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="account_invoice_report_tree" model="ir.ui.view">
|
||||
<field name="name">usability.account.invoice.report.tree</field>
|
||||
<field name="model">account.invoice.report</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Invoices Analysis">
|
||||
<field name="move_id"/>
|
||||
<field name="journal_id" optional="hide"/>
|
||||
<field name="company_id" optional="hide" groups="base.group_multi_company"/>
|
||||
<field name="invoice_date"/>
|
||||
<field name="invoice_date_due"/>
|
||||
<field name="move_type"/>
|
||||
<field name="commercial_partner_id"/>
|
||||
<field name="partner_id" optional="hide"/>
|
||||
<field name="country_id" optional="hide"/>
|
||||
<field name="industry_id" optional="hide"/>
|
||||
<field name="invoice_user_id"/>
|
||||
<field name="fiscal_position_id" optional="hide"/>
|
||||
<field name="product_id"/>
|
||||
<field name="product_categ_id" optional="hide"/>
|
||||
<field name="account_id" optional="hide"/>
|
||||
<field name="analytic_account_id" optional="hide" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="quantity" sum="1"/>
|
||||
<field name="product_uom_id" groups="uom.group_uom"/>
|
||||
<field name="price_subtotal" sum="1"/>
|
||||
<field name="state"/>
|
||||
<field name="payment_state" optional="hide"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account.action_account_invoice_report_all_supp" model="ir.actions.act_window">
|
||||
<field name="context">{'search_default_current': 1, 'search_default_supplier': 1, 'group_by': ['invoice_date']}</field> <!-- Remove group_by_no_leaf, which breaks tree view -->
|
||||
<field name="view_mode">pivot,graph</field>
|
||||
</record>
|
||||
|
||||
<record id="account.action_account_invoice_report_all" model="ir.actions.act_window">
|
||||
<field name="context">{'search_default_current': 1, 'search_default_customer': 1, 'group_by': ['invoice_date']}</field> <!-- Remove group_by_no_leaf, which breaks tree view -->
|
||||
<field name="view_mode">pivot,graph</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_invoice_report_pivot" model="ir.ui.view">
|
||||
<field name="name">usability.account.invoice.report</field>
|
||||
<field name="model">account.invoice.report</field>
|
||||
<field name="inherit_id" ref="account.view_account_invoice_report_pivot"/>
|
||||
<field name="arch" type="xml">
|
||||
<pivot position="attributes">
|
||||
<attribute name="disable_linking"></attribute>
|
||||
</pivot>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2022 Akretion France (http://www.akretion.com/)
|
||||
Copyright 2015-2020 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,18 +12,10 @@
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='account_control_ids']/.." position="after">
|
||||
<group name="usability" string="Misc" attrs="{'invisible': [('type', '!=', 'bank')]}">
|
||||
<field name="hide_bank_statement_balance" groups="account.group_account_readonly"/>
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='inbound_payment_method_line_ids']/tree/field[@name='payment_account_id']" position="attributes">
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='outbound_payment_method_line_ids']/tree/field[@name='payment_account_id']" position="attributes">
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
<!--
|
||||
<field name="bank_statements_source" position="after">
|
||||
<field name="hide_bank_statement_balance" groups="account.group_account_readonly"/>
|
||||
<field name="account_type_current_assets_id" invisible="1"/>
|
||||
</field>
|
||||
<field name="suspense_account_id" position="attributes">
|
||||
<attribute name="context">{'default_user_type_id': account_type_current_assets_id, 'default_reconcile': False}</attribute>
|
||||
</field>
|
||||
@@ -32,11 +24,10 @@
|
||||
</field>
|
||||
<field name="payment_credit_account_id" position="attributes">
|
||||
<attribute name="context">{'default_user_type_id': account_type_current_assets_id, 'default_reconcile': True}</attribute>
|
||||
</field> -->
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- TODO
|
||||
<record id="account_journal_dashboard_kanban_view" model="ir.ui.view">
|
||||
<field name="name">usability.account.journal.dashboard</field>
|
||||
<field name="model">account.journal</field>
|
||||
@@ -53,7 +44,17 @@
|
||||
</t>
|
||||
</field>
|
||||
</record>
|
||||
-->
|
||||
|
||||
<record id="view_account_journal_tree" model="ir.ui.view">
|
||||
<field name="name">usability.account.journal.tree</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="code" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_journal_search" model="ir.ui.view">
|
||||
<field name="name">usability.account.journal.search</field>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2022 Akretion France (http://www.akretion.com/)
|
||||
Copyright 2015-2020 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).
|
||||
-->
|
||||
@@ -13,4 +13,9 @@ under "Accounting > Configuration", because most users will try to find it there
|
||||
|
||||
<menuitem id="res_partner_bank_account_config_menu" action="base.action_res_partner_bank_account_form" parent="account.account_banks_menu" sequence="20"/>
|
||||
|
||||
<record id="account.menu_finance" model="ir.ui.menu">
|
||||
<!-- Replace "Invoicing" by "Accounting" -->
|
||||
<field name="name">Accounting</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2022 Akretion France (http://www.akretion.com/)
|
||||
Copyright 2015-2020 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,22 +12,20 @@
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<!--
|
||||
<field name="fiscal_position_id" position="attributes">
|
||||
<attribute name="widget">selection</attribute>
|
||||
</field>
|
||||
<field name="invoice_incoterm_id" position="attributes">
|
||||
<attribute name="widget">selection</attribute>
|
||||
</field> -->
|
||||
<button id="account_invoice_payment_btn" position="attributes">
|
||||
</field>
|
||||
<button name="action_register_payment" position="attributes">
|
||||
<attribute name="class">btn-default</attribute>
|
||||
</button>
|
||||
<button name="action_register_payment" position="before">
|
||||
<button name="%(account.account_invoices)d" type="action" string="Print" attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
</button>
|
||||
<button name="preview_invoice" position="attributes">
|
||||
<attribute name="attrs">{}</attribute>
|
||||
<attribute name="invisible">1</attribute>
|
||||
<attribute name="attrs">{'invisible': 1}</attribute>
|
||||
</button>
|
||||
<!-- move sent field and make it visible -->
|
||||
<field name="is_move_sent" position="replace"/>
|
||||
@@ -37,13 +35,19 @@
|
||||
<field name="invoice_origin" position="after">
|
||||
<field name="is_move_sent" attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
</field>
|
||||
<xpath expr="//field[@name='line_ids']/tree/field[@name='analytic_account_id']" position="attributes">
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='line_ids']/tree/field[@name='currency_id']" position="attributes">
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='line_ids']/tree/field[@name='tax_tag_ids']" position="after">
|
||||
<field name="matching_number" optional="show"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='product_id']" position="after">
|
||||
<field name="product_barcode" optional="hide"/>
|
||||
</xpath>
|
||||
<field name="invoice_source_email" position="after">
|
||||
<field name="auto_post" position="before">
|
||||
<field name="blocked"/>
|
||||
</field>
|
||||
<div role="alert" position="after">
|
||||
@@ -53,16 +57,6 @@
|
||||
This <field name="move_type"/> is marked as <b>disputed</b>.
|
||||
</div>
|
||||
</div>
|
||||
<xpath expr="//button[@name='open_duplicated_ref_bill_view']/.." position="attributes">
|
||||
<!-- show duplicate warning not only in draft state, but also in posted state -->
|
||||
<attribute name="attrs">{'invisible': ['|', ('state', '=', 'cancel'), ('duplicated_ref_ids', '=', [])]}</attribute>
|
||||
</xpath>
|
||||
<button name="button_cancel" attrs="{'invisible' : ['|', '|', ('id', '=', False), ('state', '!=', 'draft'),('move_type', '!=', 'entry')]}" position="attributes">
|
||||
<attribute name="confirm">Are you sure you want to cancel this journal entry?</attribute>
|
||||
</button>
|
||||
<button name="button_cancel" attrs="{'invisible' : ['|', '|', ('id', '=', False), ('state', '!=', 'draft'),('move_type', '==', 'entry')]}" position="attributes">
|
||||
<attribute name="confirm">Are you sure you want to cancel this invoice?</attribute>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -73,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>
|
||||
|
||||
@@ -99,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"/>
|
||||
@@ -108,10 +120,10 @@
|
||||
The drawback of this is that, if someone added a field in that group,
|
||||
he won't see the field when internal_type is not payable/receivable -->
|
||||
<xpath expr="//field[@name='blocked']/.." position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('account_type', 'not in', ('liability_payable', 'asset_receivable'))]}</attribute>
|
||||
<attribute name="attrs">{'invisible': [('account_internal_type', 'not in', ('payable', 'receivable'))]}</attribute>
|
||||
</xpath>
|
||||
<field name="account_id" position="after">
|
||||
<field name="account_type" invisible="1"/>
|
||||
<field name="company_id" position="after">
|
||||
<field name="account_internal_type" invisible="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
@@ -120,13 +132,12 @@
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="analytic_distribution" position="after">
|
||||
<field name="matching_number" position="after">
|
||||
<button title="View Journal Entry Form" type="object" name="show_account_move_form" icon="fa-arrow-right"/>
|
||||
</field>
|
||||
<!-- balance is already present
|
||||
<field name="credit" position="after">
|
||||
<field name="balance" sum="Balance" optional="show"/>
|
||||
</field> -->
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -135,6 +146,11 @@
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="unposted" position="before">
|
||||
<filter name="current_year" string="Current Year" domain="[('date', '>=', (context_today().strftime('%Y-01-01'))), ('date', '<=', (context_today().strftime('%Y-12-31')))]"/>
|
||||
<filter name="previous_year" string="Previous Year" domain="[('date', '>=', (context_today() + relativedelta(day=1, month=1, years=-1)).strftime('%Y-%m-%d')), ('date', '<=', (context_today() + relativedelta(day=31, month=12, years=-1)).strftime('%Y-%m-%d'))]"/>
|
||||
<separator/>
|
||||
</filter>
|
||||
<field name="partner_id" position="after">
|
||||
<field name="matching_number" />
|
||||
<field name="debit" filter_domain="['|', ('debit', '=', self), ('credit', '=', self)]" string="Debit or Credit"/>
|
||||
@@ -157,5 +173,21 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_move_line_pivot" model="ir.ui.view">
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_pivot"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- By default, date is split by month... but if you've been using Odoo for several years,
|
||||
the pivot table becomes very big by default: so we split by year -->
|
||||
<field name="date" position="attributes">
|
||||
<attribute name="interval">year</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account.action_move_journal_line" model="ir.actions.act_window">
|
||||
<field name="context">{'default_move_type': 'entry', 'view_no_maturity': True}</field>
|
||||
<!-- Remove 'search_default_misc_filter': 1 -->
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
20
account_usability/views/account_reconcile_model.xml
Normal file
20
account_usability/views/account_reconcile_model.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2022 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_account_reconcile_model_form" model="ir.ui.view">
|
||||
<field name="model">account.reconcile.model</field>
|
||||
<field name="inherit_id" ref="account.view_account_reconcile_model_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='line_ids']/tree/field[@name='analytic_account_id']" position="attributes">
|
||||
<attribute name="optional">show</attribute> <!-- native value: hide -->
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2018-2022 Akretion (http://www.akretion.com/)
|
||||
Copyright 2018-2020 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).
|
||||
-->
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2022 Akretion France (http://www.akretion.com/)
|
||||
Copyright 2015-2020 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).
|
||||
-->
|
||||
@@ -11,7 +11,7 @@
|
||||
<field name="model">account.tax</field>
|
||||
<field name="inherit_id" ref="account.view_tax_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="type_tax_use" position="after">
|
||||
<field name="description" position="after">
|
||||
<field name="price_include" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2017-2022 Akretion (http://www.akretion.com/)
|
||||
Copyright 2017-2020 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).
|
||||
-->
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2021-2022 Akretion (http://www.akretion.com/)
|
||||
Copyright 2021 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).
|
||||
-->
|
||||
31
account_usability/views/res_config_settings.xml
Normal file
31
account_usability/views/res_config_settings.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2020 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="res_config_settings_view_form" model="ir.ui.view">
|
||||
<field name="name">account_usability account config page</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='bank_cash']" position="inside">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" id="transfer_account">
|
||||
<div class="o_setting_left_pane"/>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="transfer_account_id"/>
|
||||
<div class="text-muted">
|
||||
Transit account when you transfer money from a bank account of your company to another bank account of your company.
|
||||
</div>
|
||||
<field name="transfer_account_id"/>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
21
account_usability/views/res_partner.xml
Normal file
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>
|
||||
@@ -1,3 +1,4 @@
|
||||
from . import account_invoice_mark_sent
|
||||
from . import account_move_reversal
|
||||
from . import res_config_settings
|
||||
from . import account_group_generate
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2015-2022 Akretion (http://www.akretion.com)
|
||||
# Copyright 2015-2020 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).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2020-2022 Akretion France (http://www.akretion.com/)
|
||||
Copyright 2020 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,4 +1,4 @@
|
||||
# Copyright 2017-2022 Akretion France (https://akretion.com/en)
|
||||
# Copyright 2017-2020 Akretion France (https://akretion.com/en)
|
||||
# @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-2022 Akretion France
|
||||
Copyright 2017-2020 Akretion France
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2018-2022 Akretion France (https://akretion.com/)
|
||||
# Copyright 2018-2020 Akretion France (https://akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
@@ -12,13 +12,14 @@ class AccountMoveReversal(models.TransientModel):
|
||||
|
||||
# Set default reversal date to original move + 1 day
|
||||
# and raise error if original move has already been reversed
|
||||
# WARNING: this wizard is also used to generate refunds
|
||||
@api.model
|
||||
def default_get(self, fields_list):
|
||||
res = super().default_get(fields_list)
|
||||
assert self._context.get('active_model') == 'account.move'
|
||||
amo = self.env['account.move']
|
||||
moves = amo.browse(self._context['active_ids'])
|
||||
if len(moves) == 1:
|
||||
if len(moves) == 1 and moves.move_type not in ('out_invoice', 'in_invoice'):
|
||||
res['date'] = moves.date + relativedelta(days=1)
|
||||
reversed_move = amo.search([('reversed_entry_id', 'in', moves.ids)], limit=1)
|
||||
if reversed_move:
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2021-2022 Akretion France (http://www.akretion.com/)
|
||||
Copyright 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).
|
||||
-->
|
||||
@@ -14,9 +14,10 @@ So, in the view, the date should be BEFORE the amount -->
|
||||
<field name="inherit_id" ref="account.view_account_payment_register_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<label for="amount" position="before">
|
||||
<field name="payment_date" position="move"/>
|
||||
<field name="payment_date" position="move"/>
|
||||
</label>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user