Merge lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0-account_easy_reconcile-analytic-account into lp:banking-addons/bank-statement-reconcile-70

Proposed by Guewen Baconnier @ Camptocamp
Status: Rejected
Rejected by: Leonardo Pistone
Proposed branch: lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0-account_easy_reconcile-analytic-account
Merge into: lp:banking-addons/bank-statement-reconcile-70
Diff against target: 56 lines (+10/-0)
3 files modified
account_easy_reconcile/base_reconciliation.py (+3/-0)
account_easy_reconcile/easy_reconcile.py (+5/-0)
account_easy_reconcile/easy_reconcile.xml (+2/-0)
To merge this branch: bzr merge lp:~camptocamp/banking-addons/bank-statement-reconcile-7.0-account_easy_reconcile-analytic-account
Reviewer Review Type Date Requested Status
Leonardo Pistone Needs Resubmitting
Ana Juaristi Olalde (community) code review Approve
Pedro Manuel Baeza code review Approve
Yannick Vaucher @ Camptocamp code review, no test Approve
Review via email: mp+213007@code.launchpad.net

This proposal supersedes a proposal from 2014-03-27.

Description of the change

Allow to set an analytic account on write-off entries created during reconciliations.

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

Please put False default to avoid extrange values (browse_null or similar) on dictionary on l.32:

'analytic_account_id': (rec_method.analytic_account_id and
                        rec_method.analytic_account_id.id or False),

Regards.

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

> Please put False default to avoid extrange values (browse_null or similar) on
> dictionary on l.32:
>
> 'analytic_account_id': (rec_method.analytic_account_id and
> rec_method.analytic_account_id.id or False),
>
> Regards.

The code is similar to the other lines around. Also, what would be the problem to have a browse_null here?

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Guewen, I don't remember exactly the actual reason for that, but there is a possible side effect that somebody pointed me on another MP at the same time I reviewed this (maybe you were even involved in that review also).

Regards.

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

Hello Pedro, I don't see either how it could return browse_null.

IMO, we could even simply write

'analytic_account_id': rec_method.analytic_account_id.id,

As if rec_method.analytic_account_id is browse_null
rec_method.analytic_account_id.id would return False

But LGTM like this.

review: Approve (code review, no test)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Yeah, I would probably remember bad the issue.

Regards.

review: Approve (code review)
Revision history for this message
Ana Juaristi Olalde (ajuaristio) wrote :

LGTM

review: Approve (code review)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

This project is now hosted on https://github.com/OCA/bank-statement-reconcile. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

Revision history for this message
Leonardo Pistone (lepistone) wrote :
review: Needs Resubmitting

Unmerged revisions

138. By Guewen Baconnier @ Camptocamp

In account_easy_reconcile, now write-off entries can be created with an analytic account

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_easy_reconcile/base_reconciliation.py'
2--- account_easy_reconcile/base_reconciliation.py 2013-01-04 08:39:10 +0000
3+++ account_easy_reconcile/base_reconciliation.py 2014-03-27 09:26:20 +0000
4@@ -188,6 +188,9 @@
5 period_id = self.pool.get('account.period').find(
6 cr, uid, dt=date, context=context)[0]
7
8+ if rec.analytic_account_id:
9+ rec_ctx['analytic_id'] = rec.analytic_account_id.id
10+
11 ml_obj.reconcile(
12 cr, uid,
13 line_ids,
14
15=== modified file 'account_easy_reconcile/easy_reconcile.py'
16--- account_easy_reconcile/easy_reconcile.py 2013-02-13 15:54:48 +0000
17+++ account_easy_reconcile/easy_reconcile.py 2014-03-27 09:26:20 +0000
18@@ -56,6 +56,9 @@
19 required=True,
20 string='Date of reconciliation'),
21 'filter': fields.char('Filter', size=128),
22+ 'analytic_account_id': fields.many2one(
23+ 'account.analytic.account', 'Analytic Account',
24+ help="Analytic account for the write-off"),
25 }
26
27 _defaults = {
28@@ -198,6 +201,8 @@
29 rec_method.account_lost_id.id),
30 'account_profit_id': (rec_method.account_profit_id and
31 rec_method.account_profit_id.id),
32+ 'analytic_account_id': (rec_method.analytic_account_id and
33+ rec_method.analytic_account_id.id),
34 'journal_id': (rec_method.journal_id and
35 rec_method.journal_id.id),
36 'date_base_on': rec_method.date_base_on,
37
38=== modified file 'account_easy_reconcile/easy_reconcile.xml'
39--- account_easy_reconcile/easy_reconcile.xml 2013-02-13 15:54:48 +0000
40+++ account_easy_reconcile/easy_reconcile.xml 2014-03-27 09:26:20 +0000
41@@ -124,6 +124,7 @@
42 <field name="account_lost_id" attrs="{'required':[('write_off','>',0)]}"/>
43 <field name="account_profit_id" attrs="{'required':[('write_off','>',0)]}"/>
44 <field name="journal_id" attrs="{'required':[('write_off','>',0)]}"/>
45+ <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
46 <field name="date_base_on"/>
47 </form>
48 </field>
49@@ -141,6 +142,7 @@
50 <field name="account_lost_id" attrs="{'required':[('write_off','>',0)]}"/>
51 <field name="account_profit_id" attrs="{'required':[('write_off','>',0)]}"/>
52 <field name="journal_id" attrs="{'required':[('write_off','>',0)]}"/>
53+ <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
54 <field name="date_base_on"/>
55 </tree>
56 </field>

Subscribers

People subscribed via source and target branches