Merge lp:~openerp-dev/openobject-addons/7.0-opw-587841-pna into lp:openobject-addons/7.0

Proposed by Pinakin Nayi (OpenERP)
Status: Work in progress
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-587841-pna
Merge into: lp:openobject-addons/7.0
Diff against target: 37 lines (+8/-1)
2 files modified
account/edi/invoice.py (+2/-1)
account/i18n/account.pot (+6/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-587841-pna
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Needs Information
Review via email: mp+156741@code.launchpad.net

This proposal supersedes a proposal from 2013-03-14.

Description of the change

Hello Sir,

I improved as per suggestion and remove unwanted spaces.

Thanks,
pna

To post a comment you must log in.
Revision history for this message
Csaba TOTH (tsabi) wrote : Posted in a previous version of this proposal

There will be double spaces, because you make: "%s %s %s" % X, ' Invoice ', Y
Make like 'Invoice' or "%s%s%s"!

Another thing instead of % i suggest to use format. Because format handles better the unicode differences (with % you should use u"%s %s %s" to be sure it will work in every situation).

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote : Posted in a previous version of this proposal

Hi Pinakin,

Agree with Csaba you will have an unwanted spaces added in case of missing values.

Please update the diff !

Thanks,
Naresh Soni
OpenERP Enterprise Services

review: Needs Fixing
Revision history for this message
Csaba TOTH (tsabi) wrote : Posted in a previous version of this proposal

I suggest:

"item_name": ' '.join([x for x in [inv.company_id.name, _('Invoice'), inv.number] if x])

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hi Pinakin,

It's fine now !

Thanks,
Naresh Soni
OpenERP Enterprise Service

review: Approve
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello pinakin,

one more test is missed ! can you check with the accented characters in company name. Does it print ?

review: Needs Information

Unmerged revisions

8854. By Pinakin Nayi (OpenERP)

[IMP]account: remove unwanted space

8853. By Pinakin Nayi (OpenERP)

[FIX]account: when try to dulpicate customer invoice with paypal account its gives traceback

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/edi/invoice.py'
2--- account/edi/invoice.py 2012-12-17 14:43:06 +0000
3+++ account/edi/invoice.py 2013-04-03 05:46:21 +0000
4@@ -20,6 +20,7 @@
5 ##############################################################################
6 from openerp.osv import osv, fields
7 from openerp.addons.edi import EDIMixin
8+from openerp.tools.translate import _
9
10 from urllib import urlencode
11
12@@ -266,7 +267,7 @@
13 params = {
14 "cmd": "_xclick",
15 "business": inv.company_id.paypal_account,
16- "item_name": inv.company_id.name + " Invoice " + inv.number,
17+ "item_name": ' '.join([x for x in [inv.company_id.name, _('Invoice'), inv.number] if x]),
18 "invoice": inv.number,
19 "amount": inv.residual,
20 "currency_code": inv.currency_id.name,
21
22=== modified file 'account/i18n/account.pot'
23--- account/i18n/account.pot 2013-03-07 12:19:34 +0000
24+++ account/i18n/account.pot 2013-04-03 05:46:21 +0000
25@@ -59,6 +59,12 @@
26 msgstr ""
27
28 #. module: account
29+#: code:/addons/account/edi/invoice.py:270
30+#, python-format
31+msgid "Invoice"
32+msgstr ""
33+
34+#. module: account
35 #: model:ir.model,name:account.model_report_aged_receivable
36 msgid "Aged Receivable Till Today"
37 msgstr ""