Community mailing list archives
Wrong python code defined for salary rule worked_rate (Worked_Rate).
condition must be true or range or python expressionOn Wed, Aug 5, 2015 at 9:13 AM, Levent Karakas <email@example.com> 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" <firstname.lastname@example.org> 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 <email@example.com> wrote:1) Add a rule to calculate daily rate (DAILY_RATE) with python code like this:result = employee.wage / 302) 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 = 30odoo 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_DAYS2015-08-04 15:42 GMT+03:00 Iman Ahmad <firstname.lastname@example.org>:
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 RegardsIman AhmadMinerva Data Pty .Ltd.P.O.BOX 4356, Geelong, VIC 3220, AustraliaTel: +962 6 588 5786