Salary Structure deduction percentage limitation

Bug #694833 reported by swissdotnet
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Wishlist
OpenERP R&D Addons Team 3

Bug Description

There is a limitation in Salary Structure Editor. The Amount Type "Percentage %" is limited to 4 numbers digits.

For an example, there is no way to put a deduction of 4.54 percents (=> 0.00454).
This limitation has to be set to 5 numbers after the decimal separator.

I'm using OpenERP 6.0 RC1

Related branches

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello,

Rather than hard code you can use digits_compute method to get precision.

Thanks.

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Low
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
milestone: none → 6.0-rc2
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

currently in hr modules we are using digits_compute=dp.get_precision('Account') => which has digits=2 (accept we can update it but it is for account)
I think we should have separate decimal precision for hr module or just for hr payroll

Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

remove the onchage from amount field let the user enter 4.54, that means that you have to add some /100 in the computations that use this field
and also change the label of the field to make it more clear, like "Percentage (in %)"

Changed in openobject-addons:
status: In Progress → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Ashvin Rathod (OpenERP) (ara-tinyerp) wrote :

Hello swissdotnet,

I have fixed the problem in lp:~openerp-dev/openobject-addons/trunk-dev-addons3-ara branch, It will be merged soon with trunk-dev-addons3

Revision No: 4615
Revision ID: <email address hidden>

Thank you,
ara

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Husen Daudi (husendaudi) wrote :

For 4.54% you can enter 0.0454 and amount field is allowing 4 decimal precision.

Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
swissdotnet (steve-jacot-guillarmod) wrote :

I'm really sorry, but I've always the same problem (OpenErp 6.0 RC2)
In Switzerland we have special deductions for insurance.
There are 0.535%, in decimal this is 0.00353. I'm unable to add this deduction in percent.
My first bug report was perhaps to simple... Sorry
Best regards !

Changed in openobject-addons:
status: Fix Released → Incomplete
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Hello swissdotnet,

Why you have change the status to incomplete ?

do you have still problem if yes you can reopen the bug and change the status to new ...

thanks
mra

Revision history for this message
swissdotnet (steve-jacot-guillarmod) wrote :

Yes... I'm unable to create a deduction of 0.535%...

Now the ticket has been reseted to new

Changed in openobject-addons:
status: Incomplete → New
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

we will keep as wishlist. in future we will try to add decimal precision for hr/hr payroll.

Changed in openobject-addons:
status: New → Won't Fix
importance: Low → Wishlist
Revision history for this message
swissdotnet (steve-jacot-guillarmod) wrote :

I really think that it is needed. If we want to use de payroll module in switzerland !

Revision history for this message
qdp (OpenERP) (qdp) wrote :

it would be better to do it before v6 ;-)

Changed in openobject-addons:
status: Won't Fix → Confirmed
Changed in openobject-addons:
milestone: 6.0-rc2 → none
Revision history for this message
Damien Raemy (damien.raemy) wrote :

Hello,

What about this bugfix?

In my opinion, you could resolve this problem like this:
In addons/hr_payroll/hr_payroll.py, there is the following line (1331):

'amount': fields.float('Amount / Percentage', digits=(16, 4)),

Here, we see the limit of 4 digits.

You could change the number (6, for example), or use db.get_precision, like in the next line:
'total': fields.float('Sub Total', readonly=True, digits_compute=dp.get_precision('Account')),
This way should allow to setup manually the number of decimal, in Administration/Customization/Database Structure/Decimal Accuracy Definition.

Thanks

Revision history for this message
Damien Raemy (damien.raemy) wrote :

Hello,

I tested my idea:
Correct this bug, you can replace the line 1331 in addons/hr_payroll/hr_payroll.py by that:

'amount': fields.float('Amount / Percentage', digits_compute=dp.get_precision('Payslip')),

And define a new Decimal Accuracy Definition (Administration/Customization/Database Structure/Decimal Accuracy Definition) named "Payslip" (you can use another name, but don't forget to change the previous line) with the number of decimal you want.

Hoping that it helps.

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Damien,

We had already improved the hr_payroll and hr_payroll_account in 6.1 with two different decimal precision "Payroll'" and "Payroll Rate".

So this issue is resolved now, would you please try with the version 6.1.

Thank you!

Changed in openobject-addons:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.