Merge lp:~vauxoo/openobject-addons/7.0-add_partner_field_hr_salary_rule_vauxoo_dev_ernesto into lp:openobject-addons/7.0

Status: Needs review
Proposed branch: lp:~vauxoo/openobject-addons/7.0-add_partner_field_hr_salary_rule_vauxoo_dev_ernesto
Merge into: lp:openobject-addons/7.0
Diff against target: 64 lines (+8/-3)
3 files modified
hr_payroll/hr_payroll.py (+3/-0)
hr_payroll_account/hr_payroll_account.py (+3/-3)
hr_payroll_account/hr_payroll_account_view.xml (+2/-0)
To merge this branch: bzr merge lp:~vauxoo/openobject-addons/7.0-add_partner_field_hr_salary_rule_vauxoo_dev_ernesto
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Pending
Luis Ernesto García Medina - http://www.vauxoo.com Pending
OpenERP Core Team Pending
Review via email: mp+222809@code.launchpad.net

Description of the change

partner_employee_ok name field. If this field check with True, it will be create journal entries with partner from partner of employee otherwise the partner of salary rule is assigned. where if the field is not selected and no partner is assigned to the salary rule no partner is assigned to the line

To post a comment you must log in.

Unmerged revisions

10067. By Luis Ernesto García Medina - http://www.vauxoo.com

[MERGE] merge with lp:openobject-addons/7.0

10066. By Luis Ernesto García Medina - http://www.vauxoo.com

[IMP][hr_payroll_account] Changes partner_employee_ok where if the field is not selected and no partner is assigned to the salary rule no partner is assigned to the line

10065. By Luis Ernesto García Medina - http://www.vauxoo.com

[REF][hr_payroll, hr_payroll_account] Changes partner_employee_ok name field. If this field check with True, it will be create journal entries with partner from partner of employee otherwise the partner of salary rule is assigned

10064. By Luis Ernesto García Medina - http://www.vauxoo.com

[IMP][hr_payroll, hr_payroll_account] added partner_employee_ok and partner_id fields to hr_salary_rule, if field partner_employee_ok is active the partner of the salary rule are assigned to the journal entries, if not , is assigned partner employee.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_payroll/hr_payroll.py'
2--- hr_payroll/hr_payroll.py 2014-04-02 08:29:54 +0000
3+++ hr_payroll/hr_payroll.py 2014-07-01 15:32:59 +0000
4@@ -801,6 +801,8 @@
5 'register_id':fields.many2one('hr.contribution.register', 'Contribution Register', help="Eventual third party involved in the salary payment of the employees."),
6 'input_ids': fields.one2many('hr.rule.input', 'input_id', 'Inputs'),
7 'note':fields.text('Description'),
8+ 'partner_employee_ok': fields.boolean('Use the partner employee', help="If this field check with True, it will be create journal entries with partner from partner of employee."),
9+ 'partner_id': fields.many2one('res.partner', 'Partner'),
10 }
11 _defaults = {
12 'amount_python_compute': '''
13@@ -844,6 +846,7 @@
14 'amount_fix': 0.0,
15 'amount_percentage': 0.0,
16 'quantity': '1.0',
17+ 'partner_employee_ok': True,
18 }
19
20 def _recursive_search_of_rules(self, cr, uid, rule_ids, context=None):
21
22=== modified file 'hr_payroll_account/hr_payroll_account.py'
23--- hr_payroll_account/hr_payroll_account.py 2014-03-04 11:31:17 +0000
24+++ hr_payroll_account/hr_payroll_account.py 2014-07-01 15:32:59 +0000
25@@ -112,7 +112,7 @@
26 }
27 for line in slip.details_by_salary_rule_category:
28 amt = slip.credit_note and -line.total or line.total
29- partner_id = line.salary_rule_id.register_id.partner_id and line.salary_rule_id.register_id.partner_id.id or default_partner_id
30+ partner_id = (line.salary_rule_id.partner_id and line.salary_rule_id.partner_id.id) or line.salary_rule_id.register_id.partner_id and line.salary_rule_id.register_id.partner_id.id
31 debit_account_id = line.salary_rule_id.account_debit.id
32 credit_account_id = line.salary_rule_id.account_credit.id
33
34@@ -121,7 +121,7 @@
35 debit_line = (0, 0, {
36 'name': line.name,
37 'date': timenow,
38- 'partner_id': (line.salary_rule_id.register_id.partner_id or line.salary_rule_id.account_debit.type in ('receivable', 'payable')) and partner_id or False,
39+ 'partner_id': (line.salary_rule_id.partner_employee_ok and default_partner_id) or partner_id or False,
40 'account_id': debit_account_id,
41 'journal_id': slip.journal_id.id,
42 'period_id': period_id,
43@@ -139,7 +139,7 @@
44 credit_line = (0, 0, {
45 'name': line.name,
46 'date': timenow,
47- 'partner_id': (line.salary_rule_id.register_id.partner_id or line.salary_rule_id.account_credit.type in ('receivable', 'payable')) and partner_id or False,
48+ 'partner_id': (line.salary_rule_id.partner_employee_ok and default_partner_id) or partner_id or False,
49 'account_id': credit_account_id,
50 'journal_id': slip.journal_id.id,
51 'period_id': period_id,
52
53=== modified file 'hr_payroll_account/hr_payroll_account_view.xml'
54--- hr_payroll_account/hr_payroll_account_view.xml 2012-11-29 22:26:45 +0000
55+++ hr_payroll_account/hr_payroll_account_view.xml 2014-07-01 15:32:59 +0000
56@@ -29,6 +29,8 @@
57 <field name="account_credit"/>
58 <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
59 <field name="account_tax_id"/>
60+ <field name="partner_employee_ok"/>
61+ <field name="partner_id" attrs="{'readonly':[('partner_employee_ok','=',True)]}"/>
62 </group>
63 </page>
64 </xpath>