Skip to Content
Menu
This question has been flagged
3027 Views

I am working in accounting module, where I need to open list of  records with  specific parter_id and  record state in open. here gose my code.

ORM :

class account_payment_ext(models.Model):
_inherit = 'account.payment'
payment_record = fields.Char(string='Payment Records')


class account_invoice_ext(models.Model):
_inherit = 'account.invoice'

Views
<odoo>
<data>

<record id="action_account_invoice_payment_inherit" model="ir.actions.act_window">
<field name="name">Payment</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.invoice</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,calendar,graph</field>
<field name="search_view_id" ref="account.invoice_tree"/>
<field name="domain">[('state', '=', 'open'),('partner_id', '=',partner_id)]</field>
<field name="context">{
'search_default_filter_partner_id': partner_id
}
</field>

</record>

<record id="account_payment_inheirt" model="ir.ui.view">
<field name="name">account.payment.inherit</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form"/>
<field name="arch" type="xml">
<data>

<field name="amount" position="after">
<a name="%(action_account_invoice_payment_inherit)d" type="action">Customer Invoices</a>
</field>


</data>
</field>
</record>

</data>
</odoo>

Error says that if cannot find partner_id. I need customer invoices of sarina as in screenshot below, when Customer Invoices link is clicked. Is there any way to do this.

 

Avatar
Discard
Related Posts Replies Views Activity
2
Nov 24
25097
2
May 24
5519
3
Mar 24
4964
0
Mar 24
263
3
Feb 24
11421