-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
l10n_fr_chorus_account: improve error management
add mail activity when chorus reject an invoice add filter for invoice in error and invoice to send reject all invoice without chorus identifier add num/sum of invoice in error in the dashboard
- Loading branch information
1 parent
95c94f7
commit a3e89bc
Showing
8 changed files
with
150 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
|
||
<record id="mail_activity_type_chorus_error" model="mail.activity.type"> | ||
<field name="name">Traité l'erreur de transmission Chorus</field> | ||
<field name="icon">fa-exclamation-triangle</field> | ||
<field name="sequence">3</field> | ||
<field name="res_model_id" ref="account.model_account_move" /> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
from . import company | ||
from . import config_settings | ||
from . import account_move | ||
from . import account_journal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright 2024 Akretion (https://www.akretion.com). | ||
# @author Sébastien BEAU <sebastien.beau@akretion.com> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
|
||
from odoo import models | ||
from odoo.tools.misc import formatLang | ||
|
||
|
||
class AccountJournal(models.Model): | ||
_inherit = "account.journal" | ||
|
||
def get_journal_dashboard_datas(self): | ||
number_chorus_error = sum_chorus_error = 0 | ||
res = super().get_journal_dashboard_datas() | ||
if self.type == "sale": | ||
data = self.env["account.move"].read_group( | ||
[ | ||
("journal_id", "=", self.id), | ||
( | ||
"activity_type_id", | ||
"=", | ||
self.env.ref( | ||
"l10n_fr_chorus_account.mail_activity_type_chorus_error" | ||
).id, | ||
), | ||
], | ||
["amount_total_signed"], | ||
["journal_id"], | ||
) | ||
if data: | ||
number_chorus_error = data[0]["journal_id_count"] | ||
currency = self.currency_id or self.company_id.currency_id | ||
sum_chorus_error = formatLang( | ||
self.env, | ||
currency.round(data[0]["amount_total_signed"]), | ||
currency_obj=currency, | ||
) | ||
res.update( | ||
{ | ||
"number_chorus_error": number_chorus_error, | ||
"sum_chorus_error": sum_chorus_error, | ||
} | ||
) | ||
return res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
l10n_fr_chorus_account/views/account_journal_dashboard_view.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
|
||
<record id="account_journal_dashboard_kanban_view" model="ir.ui.view"> | ||
<field name="model">account.journal</field> | ||
<field name="inherit_id" ref="account.account_journal_dashboard_kanban_view" /> | ||
<field name="arch" type="xml"> | ||
<div class="row" t-if="dashboard.number_waiting" position="after"> | ||
<div class="row text-danger" t-if="dashboard.number_chorus_error"> | ||
<div class="col overflow-hidden text-left"> | ||
<a | ||
type="object" | ||
name="open_action" | ||
class="text-danger" | ||
context="{'search_default_chorus_error': 1}" | ||
id="account_dashboard_error_chorus" | ||
> | ||
<t t-esc="dashboard.number_chorus_error" /> Error Chorus | ||
</a> | ||
</div> | ||
<div class="col-auto text-right"> | ||
<span><t t-esc="dashboard.sum_chorus_error" /></span> | ||
</div> | ||
</div> | ||
</div> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters