From 198c080b3512e8b7fbcd9ab47d15746776d5d1a6 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 1 Sep 2016 15:31:18 +0200 Subject: [PATCH] [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. --- .../payment_paypal/models/account_invoice.py | 23 ++----------------- 1 file 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