Skip to content

Commit

Permalink
[FIX]lcc_lokavaluto_app_connection:fix bug on partner at invoice crea…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
LaetitiaElabore authored and Stéphan Sainléger committed Nov 12, 2024
1 parent 7548704 commit 52fb287
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions lcc_lokavaluto_app_connection/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ class AccountInvoice(models.Model):
string="LCC amount to credit", compute="_compute_global_lcc_amounts"
)

partner_name = fields.Char(compute='_compute_partner_name', string="Partner Name")

@api.depends('partner_id')
def _compute_partner_name(self):
for record in self:
record.partner_name = record.partner_id.name if record.partner_id else ''

@api.depends("credit_request_ids")
def _compute_global_credit_status(self):
self.global_credit_status = status(
Expand Down
4 changes: 2 additions & 2 deletions lcc_lokavaluto_app_connection/views/account_invoice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<div class="alert alert-success" role="alert"
attrs="{'invisible': [('global_lcc_amount_credited', '=', 0)]}">
<field name="global_lcc_amount_credited" readonly="True" /> units have been
credited on <field name="partner_id" readonly="True" />'s wallet(s).</div>
credited on <field name="partner_name" />'s wallet(s).</div>
<div class="alert alert-warning" role="alert"
attrs="{'invisible': [('global_lcc_amount_to_credit', '=', 0)]}">
<field name="global_lcc_amount_to_credit" readonly="True" /> units still to
credit on <field name="partner_id" readonly="True" />'s wallet(s).</div>
credit on <field name="partner_name" />'s wallet(s).</div>
<field name="credit_request_ids" nolabel="1"
groups="lcc_lokavaluto_app_connection.group_wallet_accounts_manager">
<tree create="false" delete="false">
Expand Down

0 comments on commit 52fb287

Please sign in to comment.