Merge lp:~openerp-dev/openobject-addons/7.0-opw-596206-fka into lp:openobject-addons/7.0

Proposed by Foram Katharotiya (OpenERP)
Status: Rejected
Rejected by: Olivier Dony (Odoo)
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-596206-fka
Merge into: lp:openobject-addons/7.0
Diff against target: 12 lines (+1/-1)
1 file modified
hr_expense/hr_expense.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-596206-fka
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Disapprove
Review via email: mp+178655@code.launchpad.net

Description of the change

Hello,

I have fixed the bug of expense when we create account.move.line to account.move from expense. It's give traceback of ref field.

Thanks,
FKA

To post a comment you must log in.
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Your patch is wrong because you're taking the characters *after* 64 instead of *before*!! Please review and test the actual effect of your code before submitting it.

In any case, it seems clear to me that the right fix is to correct fields.function to properly apply the size limit that was set on it when the type is "char". In this case `ref` is a fields.related which is also a fields.function that is stored, so this is the source of the bug. It will also avoid hardcoding a limit in the code while the one of the model should be used.

Martin Trigaux is preparing a branch to fix this.

Thanks!

review: Disapprove

Unmerged revisions

9347. By Foram Katharotiya (OpenERP)

[IMP] trimmed ref field in expense.py

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_expense/hr_expense.py'
2--- hr_expense/hr_expense.py 2013-05-22 17:49:45 +0000
3+++ hr_expense/hr_expense.py 2013-08-06 04:54:30 +0000
4@@ -258,7 +258,7 @@
5 'date_maturity': exp.date_confirm,
6 'amount_currency': diff_currency_p and total_currency or False,
7 'currency_id': diff_currency_p and exp.currency_id.id or False,
8- 'ref': exp.name
9+ 'ref': exp.name[64:]
10 })
11
12 #convert eml into an osv-valid format