Merge lp:~camptocamp/banking-addons/bank-statement-reconcile-70-fix-1194881 into lp:banking-addons/bank-statement-reconcile-70

Proposed by Yannick Vaucher @ Camptocamp
Status: Merged
Merged at revision: 98
Proposed branch: lp:~camptocamp/banking-addons/bank-statement-reconcile-70-fix-1194881
Merge into: lp:banking-addons/bank-statement-reconcile-70
Diff against target: 20 lines (+9/-1)
1 file modified
account_statement_base_completion/statement.py (+9/-1)
To merge this branch: bzr merge lp:~camptocamp/banking-addons/bank-statement-reconcile-70-fix-1194881
Reviewer Review Type Date Requested Status
Romain Deheele - Camptocamp (community) code review, no test Approve
Guewen Baconnier @ Camptocamp code review, no test Approve
Review via email: mp+171560@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Couldn't you just use inv.partner_id.commercial_partner_id?
Anyway invoice.commercial_partner_id is a related to invoice.partner_id.commercial_partner_id

Your fix implies that if you don't install 'account_report_company', it will use the partner of the invoice, which can be a contact. I think that's wrong, you should probably in all cases use invoice.partner_id.commercial_partner_id.

review: Needs Fixing (code review, no test)
94. By Virgil Dupras

[IMP] Extracted the commission-handling feature from account_statement_base_import to a new module account_statement_commission.

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

account_report_company is in auto_install on account it should then be pulled and installed.

Using inv.partner_id.id is used like in webkit invoice and sale order reports where we kept compatibility with server revision pre 4946 (fixes on res.partner). So at that time commercial_partner_id wasn't in partner.

To solve contact issue, then we should use parent_id to reproduce how commercial_partner_id is computed.

Or I drop the backward compatibility and then I think we can expect account_report_company to be always installed.

95. By Vincent Renaville@camptocamp

[FIX] fix report lang

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Thanks for the explanation, sounds good.

review: Approve (code review, no test)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Can someone give the final approve and merge please.

Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

LGTM,

Romain

review: Approve (code review, no test)
96. By Yannick Vaucher @ Camptocamp

[MRG] improve aspect of the reconcile button

97. By Yannick Vaucher @ Camptocamp

[MRG] account_statement_ext improvements

docstring for Statement default profile
hide type column in bank statement line
add a sequence on bank profile and set the first of the company as default
hide useless information on bank statement
move profile to top
simplify xpath in xml views
rename profil to profile

98. By Yannick Vaucher @ Camptocamp

[MRG][FIX] account_statement_base_completion - use invoice commercial_partner_id instead of partner

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_statement_base_completion/statement.py'
2--- account_statement_base_completion/statement.py 2013-04-30 09:51:39 +0000
3+++ account_statement_base_completion/statement.py 2013-06-26 13:50:53 +0000
4@@ -178,7 +178,15 @@
5 res = {}
6 inv = self._find_invoice(cr, uid, line, inv_type, context=context)
7 if inv:
8- res = {'partner_id': inv.partner_id.id,
9+ # FIXME use only commercial_partner_id of invoice in 7.1
10+ # this is for backward compatibility in 7.0 before
11+ # the refactoring of res.partner
12+ if hasattr(inv, 'commercial_partner_id'):
13+ partner_id = inv.commercial_partner_id.id
14+ else:
15+ partner_id = inv.partner_id.id
16+
17+ res = {'partner_id': partner_id,
18 'account_id': inv.account_id.id,
19 'type': inv_type}
20 override_acc = line['master_account_id']

Subscribers

People subscribed via source and target branches