Merge lp://staging/~acsone-openerp/account-financial-tools/account_partner_required-sbi into lp://staging/~account-core-editors/account-financial-tools/7.0

Proposed by Stéphane Bidoul (Acsone)
Status: Merged
Merged at revision: 188
Proposed branch: lp://staging/~acsone-openerp/account-financial-tools/account_partner_required-sbi
Merge into: lp://staging/~account-core-editors/account-financial-tools/7.0
Diff against target: 382 lines (+351/-0)
6 files modified
account_partner_required/__init__.py (+23/-0)
account_partner_required/__openerp__.py (+46/-0)
account_partner_required/account.py (+96/-0)
account_partner_required/account_view.xml (+35/-0)
account_partner_required/tests/__init__.py (+30/-0)
account_partner_required/tests/test_account_partner_required.py (+121/-0)
To merge this branch: bzr merge lp://staging/~acsone-openerp/account-financial-tools/account_partner_required-sbi
Reviewer Review Type Date Requested Status
Omar (Pexego) code review Approve
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Lorenzo Battistini (community) code review Approve
Frederic Clementi - Camptocamp Pending
Review via email: mp+216442@code.staging.launchpad.net

Description of the change

New module to control the partner field in account move lines.

In many cases, it is desirable to enforce the presence of the
partner field in account move lines, but not always.

This module provides such a mechanism based on the account user type.

Cfr mailing list discussion for reference.

[1] https://lists.launchpad.net/openerp-community/msg05502.html

To post a comment you must log in.
175. By Stéphane Bidoul (Acsone)

[IMP] add policy column in account type tree view

176. By Stéphane Bidoul (Acsone)

[IMP] local import

177. By Stéphane Bidoul (Acsone)

[IMP] header comments

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Hello Stéphane,

why not using '_constraints' member instead of overriding create and write methods?

Is there any technical reason to avoid YAML tests?

Thanks!

review: Needs Information
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Hello Lorenzo,

About the constraints. This module is heavily inspired by account_analytic_required which used the same technique. I must confess I did not question the approach. Initially account_analytic_required was working mainly on the vals dictionary so it would have been faster than constraints. While working on account_partner_required I identified a bug in account_analytic_required which required a refactoring [1] which possibly rendered the optimization less obvious. Now since there are really two constraints to be checked based on the policy, the current approach is probably still slightly faster.

Would you agree to keep the current approach and postpone a possible performance test / refactoring with constraints to another MP?

Regarding yml vs unittest, it's only a matter of personal taste in this case. I notice the unittest2 framework seems better documented [2]. But hey, at least I have tests, right :)

[1] https://code.launchpad.net/~acsone-openerp/account-analytic/account_analytic_required-test_suite-sbi
[2] https://doc.openerp.com/trunk/server/05_test_framework/

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Ok :-)

review: Approve (code review)
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi Stéphane,

Thanks for the contrib, and as usual, thanks for providing tests :)

LGMT,

Regards,

Joël

review: Approve (code review, no tests)
Revision history for this message
Omar (Pexego) (omar7r) wrote :

LGTM

review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches