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

Proposed by Pinakin Nayi (OpenERP)
Status: Superseded
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 Fixing
Review via email: mp+153289@code.launchpad.net

This proposal has been superseded by a proposal from 2013-04-03.

Description of the change

Hello Sir,

I fixed issue in account/edi.

To Reproduce:

1. Take fresh db
2. Install account module
3. Give paypal account value in paypal_account (Setting>Configuraion>Accounting)
4. Create a customer invoices without validating it and then duplicate its give traceback.

Thanks,
pna

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

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 :

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 :

I suggest:

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

8854. By Pinakin Nayi (OpenERP)

[IMP]account: remove unwanted space

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
=== modified file 'account/edi/invoice.py'
--- account/edi/invoice.py 2012-12-17 14:43:06 +0000
+++ account/edi/invoice.py 2013-04-03 05:43:23 +0000
@@ -20,6 +20,7 @@
20##############################################################################20##############################################################################
21from openerp.osv import osv, fields21from openerp.osv import osv, fields
22from openerp.addons.edi import EDIMixin22from openerp.addons.edi import EDIMixin
23from openerp.tools.translate import _
2324
24from urllib import urlencode25from urllib import urlencode
2526
@@ -266,7 +267,7 @@
266 params = {267 params = {
267 "cmd": "_xclick",268 "cmd": "_xclick",
268 "business": inv.company_id.paypal_account,269 "business": inv.company_id.paypal_account,
269 "item_name": inv.company_id.name + " Invoice " + inv.number,270 "item_name": ' '.join([x for x in [inv.company_id.name, _('Invoice'), inv.number] if x]),
270 "invoice": inv.number,271 "invoice": inv.number,
271 "amount": inv.residual,272 "amount": inv.residual,
272 "currency_code": inv.currency_id.name,273 "currency_code": inv.currency_id.name,
273274
=== modified file 'account/i18n/account.pot'
--- account/i18n/account.pot 2013-03-07 12:19:34 +0000
+++ account/i18n/account.pot 2013-04-03 05:43:23 +0000
@@ -59,6 +59,12 @@
59msgstr ""59msgstr ""
6060
61#. module: account61#. module: account
62#: code:/addons/account/edi/invoice.py:270
63#, python-format
64msgid "Invoice"
65msgstr ""
66
67#. module: account
62#: model:ir.model,name:account.model_report_aged_receivable68#: model:ir.model,name:account.model_report_aged_receivable
63msgid "Aged Receivable Till Today"69msgid "Aged Receivable Till Today"
64msgstr ""70msgstr ""