Community mailing list archives

community@mail.odoo.com

Re: New Module

by
Skillteam, Houssine BAKKALI
- 04/25/2015 03:01:53

Dear,

You should definitely read the developer documentation that Jay gave you in the first place. Putting a function in pgadmin means that you don't even understand the basic concept. The doc for developer is a good start and you should go that way anx after that come with question. Do your part of the job : read the docs...

Le 24 avr. 2015 22:42, "Lakshay Rambaccus" <lakshay2608@gmail.com> a écrit :
Thank you OpenERP Master, Could you please give me an example, based on my codes above, where and how the function should be fitted please? I have created a function in pgAdmin.
Thanking you in anticipation

On Thu, Apr 23, 2015 at 10:29 PM, OpenERP Master <openerpmaster@gmail.com> wrote:
you could make this result without a button using onchange events.

in your xml file just say on_change="function_name(salary, bonus, etc)" on each field, pass all values
the total will auto calculate each time a field value is changed.

On Thu, Apr 23, 2015 at 9:42 AM, Lakshay Rambaccus <lakshay2608@gmail.com> wrote:
Dear Jay,
Please find attached a screenshot of my new module. It will help me in clarifying my queries.I'll try to explain a bit deeper.
For the time being, suppose these textfields contain some values as they will be retrieved from the database: Bonus ID, Employee Name, Basic Salary and Sales Amount.
The user will input the percentage bonus.
On clicking the button 'Calculate bonus', the textfield 'Bonus Allocated' should be filled automatically. (Basic Salary * Percentage Bonus)
Also, the textfield 'Total Salary' should be populated automatically with the total. (Basic Salary + Bonus Allocated).

Hope you can help me find a ray of hope.
Thanking you in advance Mr. Jay




On Thu, Apr 23, 2015 at 6:08 PM, Jay Vora <vora.jay@serpentcs.com> wrote:
Dear Lakshay,

This purely depends on what you want to perform. Result on saving of the record, or the result on updating field values on the fly Or on the call of a button.

You can check the existing modules to see if you plan for self-learning.

Thanks.

On Thu, Apr 23, 2015 at 5:58 PM, Lakshay Rambaccus <lakshay2608@gmail.com> wrote:
Thanks for replying. About the trigger. Where must i create it? and how to create it ? Thanking you in advance.

On Thu, Apr 23, 2015 at 3:23 PM, Jay Vora <vora.jay@serpentcs.com> wrote:
Lakshay,

You've put the fields on display(view). If you have a need to do any calc on the fields, you will have to have a trigger(onchange, button call, automated call) so that the fields on display will do some calculation.

The methods are a way to manage the server side computation of the fields.

Better if you go through the online training, or the doc.odoo.com.

Thanks.

On Thu, Apr 23, 2015 at 4:42 PM, Lakshay Rambaccus <lakshay2608@gmail.com> wrote:
Unfortunately, I am new to Odoo. I don't know about any methods or function fields. Can you please elaborate ? Thanks

On Thu, Apr 23, 2015 at 7:58 AM, Jay Vora (SerpentCS) <vora.jay@serpentcs.com> wrote:
Hi,

You may use function fields to calculate them, you may use button call and that method will read self.fieldname.

Do you know methods?

As an option, there is a self-paced Online #odoo beginner to expert level in-depth technical training by #SerpentCS
https://t.co/yxjyTemmR5. Coupon code SCS40 for 40% discount.

Regards,
Jay Vora.
Serpent Consulting Services Pvt Ltd.


-------- Original Message --------
From:Lakshay Rambaccus <lakshay2608@gmail.com>
Sent:Thu, 23 Apr 2015 02:47:30 +0530
To:Community <community@mail.odoo.com>
Subject:New Module

Hello all,
I have successfully created a new module in Odoo 8.
I have also been able to set up a few fields which are accompanied by their respective textfields. I want to know how i can retrieve values from these newly created textfields so that i can use them in python functions (For example: calculate bonus)

_______________________________________________

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
The Splendid journey of 2 years in Numbers
---
Regards,
Jay Vora,
Managing Director,
<img src="cid:part1.09000700.05080805@serpentcs.com" style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Serpent Consulting Services Pvt. Ltd.
Web : http://www.serpentcs.com
Mobile : 91 - 9879354457
Twitter: jaynvora
Skype: jaynvora
Blog : http://jayvora.blogspot.com

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
The Splendid journey of 2 years in Numbers
---
Regards,
Jay Vora,
Managing Director,
<img src="cid:part1.09000700.05080805@serpentcs.com" style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Serpent Consulting Services Pvt. Ltd.
Web : http://www.serpentcs.com
Mobile : 91 - 9879354457
Twitter: jaynvora
Skype: jaynvora
Blog : http://jayvora.blogspot.com

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe