Odoo Help

0

Calling Python code from application

By
Andrija Burlic
on 11/10/14, 4:40 AM 803 views

Hi, I'm doing nice with OpenERP, but some help is always appreciated :)
When I want to call some Python funstions within the application (not via code, I know that), what's the right syntax?


For example, if I want to manually set up some workflow, in segment Python Action i should write some Python code. This is easy with some simplier code lines, but I have troubles calling some other Python functions, like:

states=pool.get('request.state')

or 

all_groups=self.pool.get('res.groups')

 

see link: http://screencast.com/t/dY3Db0ppsf

 

Error I'm getting is "SyntaxError: invalid syntax".

Can someone give me a hint?

Thanks in advance!

actually i coulnt understand your requirement..?

Anand
on 11/10/14, 4:50 AM

I updated question, check link above.

Andrija Burlic
on 11/10/14, 5:32 AM
0

Bole

--Bole--
2435
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 11/10/14, 8:08 AM

Better way of using python actions is to call a method from the object.. 

Check account_invoice workflow, action open (validating the invoice triggers 4 methods)...
If you need to modify something .. you have 2 choices.. 
1. override existing method 
2. add new method to specific action...

You can also use python syntax ( check account_invoice action proforma )
where it youst writes new value for state 

if more help or explanation needed.. feel free to ask : )

may the source be with you!

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: 11/10/14, 4:40 AM
Seen: 803 times
Last updated: 3/16/15, 8:10 AM