summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-09-01 15:31:18 +0200
committerChristophe Simonis <chs@odoo.com>2016-09-01 15:31:18 +0200
commit198c080b3512e8b7fbcd9ab47d15746776d5d1a6 (patch)
tree1b361e1ef8db0fb3b8cca35c45471fabbb200f4f
parentc7a2503326a459245cbc4d8cfeb9bc4dc6ec866e (diff)
[FIX] payment_paypal: do not compute field `paypal_url`
Since 85bcd6fdd86123e26a022d07be21b1e8bc16a771, the field `paypal_account` has been removed. The field `paypal_url` cannot be computed correctly anymore. Convert it to a dummy field.
-rw-r--r--addons/payment_paypal/models/account_invoice.py23
1 files changed, 2 insertions, 21 deletions
diff --git a/addons/payment_paypal/models/account_invoice.py b/addons/payment_paypal/models/account_invoice.py
index 7b7f3e377b7..3a9704d6160 100644
--- a/addons/payment_paypal/models/account_invoice.py
+++ b/addons/payment_paypal/models/account_invoice.py
@@ -1,27 +1,8 @@
# -*- coding: utf-8 -*-
-from openerp import models, fields, api
-
-import werkzeug.urls
+from openerp import models, fields
class AccountInvoice(models.Model):
_inherit = 'account.invoice'
- paypal_url = fields.Char('Paypal Url', compute='_compute_paypal_url')
-
- @api.depends('type', 'number', 'company_id', 'currency_id')
- def _compute_paypal_url(self):
- for inv in self:
- if inv.type == 'out_invoice' and inv.company_id.paypal_account:
- params = {
- "cmd": "_xclick",
- "business": inv.company_id.paypal_account,
- "item_name": "%s Invoice %s" % (inv.company_id.name, inv.number or ''),
- "invoice": inv.number,
- "amount": inv.residual,
- "currency_code": inv.currency_id.name,
- "button_subtype": "services",
- "no_note": "1",
- "bn": "Odoo_Invoice_PayNow_" + inv.currency_id.name,
- }
- inv.paypal_url = "https://www.paypal.com/cgi-bin/webscr?" + werkzeug.url_encode(params)
+ paypal_url = fields.Char('Paypal Url', store=False) # dummy field