Skip to content
Snippets Groups Projects
Commit e5983db8 authored by Benjamin - Le Filament's avatar Benjamin - Le Filament
Browse files

[update] update result of JSON reconcile widget to add maturity date

parent 43b72485
No related branches found
No related tags found
No related merge requests found
# © 2020 Le Filament (<http://www.le-filament.com>) # © 2020 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import json
from odoo import api, fields, models from odoo import api, fields, models
...@@ -75,48 +76,19 @@ class ScopAccountMove(models.Model): ...@@ -75,48 +76,19 @@ class ScopAccountMove(models.Model):
# ------------------------------------------------------ # ------------------------------------------------------
# Override Parent # Override Parent
# ------------------------------------------------------ # ------------------------------------------------------
# TODO: check if necessary def _compute_payments_widget_to_reconcile_info(self):
# def _get_outstanding_info_JSON(self): """
# super(ScopAccountMove, self)._get_outstanding_info_JSON() Modifie les données de sortie du JSON de réconciliation pour ajouter
# info = json.loads(self.outstanding_credits_debits_widget) la date d'échéance
# if info: """
# values = info.get("content", False) super()._compute_payments_widget_to_reconcile_info()
# if self.state == "open" and values: for move in self:
# domain = [ info = json.loads(move.invoice_outstanding_credits_debits_widget)
# ("account_id", "=", self.account_id.id), if info:
# ( lines_info = info["content"]
# "partner_id", for line in lines_info:
# "=", line_id = move.line_ids.browse(line.get("id"))
# self.env["res.partner"] line.update(
# ._find_accounting_partner(self.partner_id) {"date_maturity": fields.Date.to_string(line_id.date_maturity)}
# .id, )
# ), move.invoice_outstanding_credits_debits_widget = json.dumps(info)
# ("reconciled", "=", False),
# ("move_id.state", "=", "posted"),
# "|",
# "&",
# ("amount_residual_currency", "!=", 0.0),
# ("currency_id", "!=", None),
# "&",
# ("amount_residual_currency", "=", 0.0),
# "&",
# ("currency_id", "=", None),
# ("amount_residual", "!=", 0.0),
# ]
# if self.type in ("out_invoice", "in_refund"):
# domain.extend([("credit", ">", 0), ("debit", "=", 0)])
# else:
# domain.extend([("credit", "=", 0), ("debit", ">", 0)])
# lines = self.env["account.move.line"].search(domain)
# for value in values:
# for line in lines:
# if value.get("id") == line.id:
# value.update(
# {
# "date_maturity": datetime.strftime(
# line.date_maturity, "%d/%m/%Y"
# ),
# "invoice": line.invoice_id.number,
# }
# )
# self.outstanding_credits_debits_widget = json.dumps(info)
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
<div <div
class="oe_form_field" class="oe_form_field"
style="margin-right: 10px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;" style="margin-right: 10px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;"
t-att-title="line.date_maturity + ' - ' + line.title" t-att-title="line.date_maturity + ' - ' + line.journal_name"
> >
<t t-esc="line.date_maturity" /> - <t t-esc="line.invoice" /> <t t-esc="line.date_maturity" /> - <t t-esc="line.journal_name" />
</div> </div>
</t> </t>
</t> </t>
......
...@@ -65,10 +65,16 @@ ...@@ -65,10 +65,16 @@
<field name="mode">primary</field> <field name="mode">primary</field>
<field name="inherit_id" ref="account.view_invoice_tree" /> <field name="inherit_id" ref="account.view_invoice_tree" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//field[@name='invoice_partner_display_name']" position="before"> <xpath
expr="//field[@name='invoice_partner_display_name']"
position="before"
>
<field name="partner_member_number" readonly="1" /> <field name="partner_member_number" readonly="1" />
</xpath> </xpath>
<xpath expr="//field[@name='invoice_partner_display_name'][2]" position="attributes"> <xpath
expr="//field[@name='invoice_partner_display_name'][2]"
position="attributes"
>
<attribute name="string">Adhérent</attribute> <attribute name="string">Adhérent</attribute>
</xpath> </xpath>
<xpath expr="//field[@name='invoice_origin']" position="after"> <xpath expr="//field[@name='invoice_origin']" position="after">
......
...@@ -22,7 +22,7 @@ class ContributionAccountMoveReversal(models.TransientModel): ...@@ -22,7 +22,7 @@ class ContributionAccountMoveReversal(models.TransientModel):
"year": move.year, "year": move.year,
"is_contribution": move.is_contribution, "is_contribution": move.is_contribution,
"type_contribution_id": move.type_contribution_id.id, "type_contribution_id": move.type_contribution_id.id,
"payment_term_id": move.payment_term_id.id, "invoice_payment_term_id": move.invoice_payment_term_id.id,
} }
) )
return refund return refund
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment