Community mailing list archives

community@mail.odoo.com

Re: Payslips

by
Projetgrup, Levent Karakaş
- 08/05/2015 03:15:25

It's not very easy to find errors in salary rules. Try smaller pieces of code and add more till you find the error.

Some hints for you: make sure code exist in structure.

5 Ağu 2015 09:22 tarihinde "Iman Ahmad" <iman.ahmad@minervadata.com> yazdı:
it gives me this error 

Error!

Wrong python code defined for salary rule worked_rate (Worked_Rate).


On Wed, Aug 5, 2015 at 9:17 AM, Iman Ahmad <iman.ahmad@minervadata.com> wrote:
condition must be true or range or python expression 

On Wed, Aug 5, 2015 at 9:13 AM, Levent Karakas <levent@mektup.at> wrote:

Select no condition and python as calculation type. You will have a field to write python code.

I realised i made a mistake: use contract.wage instead of employee.wage.

5 Ağu 2015 08:41 tarihinde "Iman Ahmad" <iman.ahmad@minervadata.com> yazdı:
Thanks all 

Levent Karakas  can you please tell me where to write each on of these codes 
is it in the salary rule result field ? 


On Tue, Aug 4, 2015 at 4:18 PM, Levent Karakas <levent@mektup.at> wrote:
1) Add a rule to calculate daily rate (DAILY_RATE) with python code like this:

result = employee.wage / 30


2) then you will need to add another rule and use this to count total number of days (WORKED_DAYS) worked like this:

result = 0 for line in payslip.worked_days_line_ids: result += line.number_of_days if result >= 28: result = 30


odoo automatically decrements leaves from work days (WORK100.days), but unfortunately weekends are not counted here. we added another automatically computed entry here for weekends with python code.


3) finally add another rule to calculate the wage:

result = DAILY_RATE * WORKED_DAYS






2015-08-04 15:42 GMT+03:00 Iman Ahmad <iman.ahmad@minervadata.com>:

I want to generate payslips which takes the total wage and divide it to 30 and then multiply it by the number of days the employee work (which are equal to 30- leaves )

how can i achieve this 

any help ?


--
Best Regards
Iman Ahmad
Minerva Data Pty .Ltd.
P.O.BOX 4356, Geelong, VIC 3220, Australia

_______________________________________________
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




--
Best Regards
Iman Ahmad
Minerva Data Pty .Ltd.
P.O.BOX 4356, Geelong, VIC 3220, Australia

_______________________________________________
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




--
Best Regards
Iman Ahmad
Minerva Data Pty .Ltd.
P.O.BOX 4356, Geelong, VIC 3220, Australia



--
Best Regards
Iman Ahmad
Minerva Data Pty .Ltd.
P.O.BOX 4356, Geelong, VIC 3220, Australia

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