Merge lp:~sebastien.beau/openerp-fiscal-rules/openerp-fiscal-rules-fix-multicompany into lp:openerp-fiscal-rules

Proposed by Sébastien BEAU - http://www.akretion.com
Status: Needs review
Proposed branch: lp:~sebastien.beau/openerp-fiscal-rules/openerp-fiscal-rules-fix-multicompany
Merge into: lp:openerp-fiscal-rules
Diff against target: 17 lines (+4/-3)
1 file modified
account_fiscal_position_rule/account_fiscal_position_rule.py (+4/-3)
To merge this branch: bzr merge lp:~sebastien.beau/openerp-fiscal-rules/openerp-fiscal-rules-fix-multicompany
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp Needs Resubmitting
Yannick Vaucher @ Camptocamp Needs Information
Pedro Manuel Baeza Needs Information
Review via email: mp+195614@code.launchpad.net

Description of the change

Fix bug in case of multicompany

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Sébastien,

Don't you need the child_of operator instead the equality?

Regards.

review: Needs Information
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Is there a bug report we can link to this fix ?

review: Needs Information
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

As there was no activity for a while I set this as WIP

Revision history for this message
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote :

Hi sorry for the delay. And sorry for my first comment which was really light.

There is no bug report yet. I just found the bug and I fix it.
A simple way to reproduce it is
Create 2 company
- Company A
- Company B
Install French chart of account
Install French fiscal rule : https://code.launchpad.net/~account-core-editors/openerp-fiscal-rules/l10n_fr_rule

Then with the user "admin" load the fiscal rule.

As the admin is a super user he can see everything and openerp will mix the fiscal_rule of company A and B with the fiscal position of company A/B.

As it's accounting information we do not share it (I never share accounting information in all of my project, each company have always his own chart of account, his own tax, his own fiscal position...). This is why we can restrict it to a company_id.

What do you think?

Revision history for this message
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote :

For the next time I will create a bug report first ;).
If it's needed I can still create one for this issue, what do you think?

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

@sebastien the management of the source code has moved to github. Could you resubmit this MP as a PR over there?

review: Needs Resubmitting

Unmerged revisions

65. By Sébastien BEAU - http://www.akretion.com

[FIX] fis issue in multicompany, we must take a fiscal position of the company

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_fiscal_position_rule/account_fiscal_position_rule.py'
2--- account_fiscal_position_rule/account_fiscal_position_rule.py 2013-10-15 09:16:04 +0000
3+++ account_fiscal_position_rule/account_fiscal_position_rule.py 2013-11-18 14:24:25 +0000
4@@ -267,9 +267,10 @@
5 if fpr_template.fiscal_position_id:
6
7 fp_ids = obj_fp.search(
8- cr, uid,
9- [('name', '=', fpr_template.fiscal_position_id.name)],
10- context=context)
11+ cr, uid, [
12+ ('name', '=', fpr_template.fiscal_position_id.name),
13+ ('company_id', '=', obj_wizard.company_id.id),
14+ ], context=context)
15
16 if not fp_ids:
17 continue