Skip to Content
Menu
This question has been flagged
1 Reply
3539 Views

Hello community 

this code show the number of invoice for correspondent partner ,but i didn't understand it can you explain this code to me especially the 2 first line

def action_view_invoice(self):

action = self.env.ref('account.action_invoice_refund_out_tree')

result = action.read()[0]

Avatar
Discard
Best Answer


la primera linea, 

action = self.env.ref('account.action_invoice_refund_out_tree') 

realiza una referencia a account y va a la vista action_invoice_refund_out_tree, si le das un.

 print (action) 

puedes ver todos los valores que tiene.
y de ahi puedes cambiar el domain, context, etc


action['domain'] = [
('type', 'in', ('out_invoice', 'out_refund')), 
]


Avatar
Discard