Skip to Content
Menu
This question has been flagged
2772 Views

In which case we use the attribute _depends  in odoo classes ? 

Ex: in account/report/account_invoice_report.py

...

_depends = { 'account.invoice': [ 'account_id', 'amount_total_company_signed', 'commercial_partner_id', 'company_id', 'currency_id', 'date_due', 'date_invoice', 'fiscal_position_id', 'journal_id', 'partner_bank_id', 'partner_id', 'payment_term_id', 'residual', 'state', 'type', 'user_id', ],

'account.invoice.line': [ 'account_id', 'invoice_id', 'price_subtotal', 'product_id', 'quantity', 'uom_id', 'account_analytic_id', ], 'product.product': ['product_tmpl_id'], 'product.template': ['categ_id'], 'product.uom': ['category_id', 'factor', 'name', 'uom_type'],

'res.currency.rate': ['currency_id', 'name'], 'res.partner': ['country_id'],

}

...

Avatar
Discard
Related Posts Replies Views Activity
7
Apr 19
14086
3
Jan 19
7422
3
Jul 16
25305
1
Apr 16
2918
1
Mar 16
3086