Odoo Help

0

How to get data from table odoo v8?

By
HappyOdoo
on 4/8/16, 1:42 AM 801 views

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.


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.

Yenthe
on 4/8/16, 2:15 AM
yenthe,

i am  asking to get the data from the field 'origin'.
i have develop one inherit module and create one new ref = field.char,
on this field i want to assign value as in Origin field.
means  ref value = origin value.
 

On Fri, Apr 8, 2016 at 11:45 AM, Yenthe <yenthespam@gmail.com> wrote:

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.

--
Yenthe

Sent by Odoo S.A. using Odoo





HappyOdoo
on 4/8/16, 2:48 AM
0
Jose Vasquez
On 4/8/16, 4:03 PM
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

0
Dion Martin
On 4/8/16, 3:38 AM

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

Yenthe
on 4/8/16, 3:54 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 4/8/16, 1:42 AM
Seen: 801 times
Last updated: 4/8/16, 4:03 PM