New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[10.0] [ADD] hr_payroll_account_operating_unit #82
[10.0] [ADD] hr_payroll_account_operating_unit #82
Conversation
@aheficent Could you please review code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only code review 😐
for slip in self: | ||
# Check that all slips are related to contracts | ||
# that belong to the same OU. | ||
if OU: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't compare directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is comparing the OU in contracts between the Payslip. I don't see the use case for this though.
Btw, what changes do you want me to make?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if there is a way to map the contracts by different OU and if there was more than one raise the error. But I'm not really sure and this works. It's ok to me.
@api.multi | ||
def write(self, vals): | ||
res = super(HrPayslip, self).write(vals) | ||
if 'move_id' in vals and vals['move_id']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use vals.get('move_id', False)
but it's the same
# that belong to the same OU. | ||
if OU: | ||
if slip.contract_id.operating_unit_id.id != OU: | ||
raise UserError(_('Configuration error!\nThe Contracts must\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The \n is not needed just close the quotes and continue in the next line
slip.contract_id.operating_unit_id.id}) | ||
if slip.move_id.line_ids: | ||
slip.move_id.line_ids.\ | ||
write({'operating_unit_id': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't be better to include this in the account_move class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get you?! Do you want me to move this whole thing to while account_move are created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In v9 it was done by passing the operating unit in the context and then overriding the create method in the account_move. But maybe this is good so leave it like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, Thanks
Code looks now. We have to wait to the dependencies are merged. |
8f0bb92
to
c03cbd5
Compare
Superseded by #127 |
HR Payroll Account with Operating Units
This module introduces the following features: