fix issue in payments

This commit is contained in:
ronozoro 2024-10-03 05:02:37 -07:00
parent 8143412d16
commit df2769b7b9
No known key found for this signature in database
GPG Key ID: 7C2BDED35C62C0F3
2 changed files with 13 additions and 4 deletions

View File

@ -61,7 +61,14 @@ class AccountMove(models.Model):
is_check = fields.Boolean(defaul=False)
is_approve = fields.Boolean(defaul=False)
hide_budget = fields.Boolean(defaul=False,copy=False)
rec_payment_count = fields.Integer(compute='_compute_rec_payment_count', string='# Payments')
def _compute_rec_payment_count(self):
for invoice in self:
payments = self.env['account.payment'].seach_count([
('invoice_rec_id', '=', invoice.id)
])
invoice.rec_payment_count = payments
def action_open_related_payment_records(self):
""" Opens a tree view with related records filtered by a dynamic domain """

View File

@ -13,7 +13,7 @@
</field>
</record>
<record id="view_budget_analytic_account_form_custom" model="ir.ui.view">
<record id="view_budget_analytic_account_form_custom" model="ir.ui.view">
<field name="name">analytic.analytic.account.form.custom</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
@ -26,7 +26,6 @@
</record>
<record model="ir.ui.view" id="crossovered_budget_view_form_inherit">
<field name="name">crossovered.budget.inherit.view.form</field>
<field name="model">crossovered.budget</field>
@ -74,8 +73,11 @@
<xpath expr="//div[hasclass('oe_button_box')]" position="inside">
<button class="oe_stat_button" name="open_confirmation" type="object" string="Budget Confirmation"
attrs="{'invisible': [('move_type', '!=', 'in_invoice')]}"/>
<button class="oe_stat_button" name="action_open_related_payment_records" type="object"
string="Payments" attrs="{'invisible': [('move_type', '!=', 'in_invoice')]}"/>
<button name="action_open_related_payment_records" type="object"
class="oe_stat_button" icon="fa-money"
attrs="{'invisible': [('move_type', '!=', 'in_invoice')]}">
<field name="rec_payment_count" widget="statinfo" string="الدفعات"/>
</button>
</xpath>
<button name="button_cancel" position="attributes">