how we can get data from Inherited table.
i have one Inherited module.
_inherit = 'account.invoice'
Now, i want to get filed 'Origin' for Particular Invoice.
How it's possible.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
how we can get data from Inherited table.
i have one Inherited module.
_inherit = 'account.invoice'
Now, i want to get filed 'Origin' for Particular Invoice.
How it's possible.
def function_name (self,cr,uid,contex=None):
account_obj = self.pool.get('account.invoice')
account_search = account_obj.search(cr,uid,[])
for account in account_obj(cr,uid,account_search):
print account.origin
# or
def funcion_name (self,cr,uid,context=None):
account_obj = self.pool.get('account.invoice')
account = account_obj.browse(cr,uid,id_account_invoice)
print account.origin
I hope it helps you. regards
u are already inherit account.invoice, and why u create another field to get some field in same object?
u can rename the origin field and change with something that u need,
it can be different if that origin field will use in another object u can use self.pool.get and browse
or in the new api: self.en['model.name'].search
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Nov 22
|
1707 | ||
|
0
Feb 21
|
1443 | ||
|
0
Sep 24
|
140 | ||
|
2
Oct 24
|
146 | ||
one2one relational field
Solved
|
|
3
Sep 24
|
9978 |
Your question is rather confusing. Are you asking to inherit the field 'Origin' to change some attribute? Are you asking to inherit the field 'Origin' on the view in order to perform actions on it? Are you asking to get the data from the field 'Origin' on an invoice or? Please add some more info / code.