diff options
| author | Shivam Dudhat <sdu@odoo.com> | 2016-08-29 15:49:13 +0200 |
|---|---|---|
| committer | Damien Bouvy <dbo@odoo.com> | 2016-09-01 15:58:41 +0200 |
| commit | ba87ff438d1cdf5e1f5c57563a16a17f6eea6529 (patch) | |
| tree | 21a185180a7ee5453d9d5500e1540ca5f62a760e | |
| parent | a2d249f1a4d4c64c01e2c8c3f1145b817b7544e3 (diff) | |
[IMP] payment: avoid warning on payment.token creation
Since the creates overrides needs some information that do not end up
in the final record, let's avoid warning by removing all non-model
fields from the call to super.
| -rw-r--r-- | addons/payment/models/payment_acquirer.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index aed9564d234..d0733c16fe3 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -617,8 +617,10 @@ class PaymentToken(models.Model): custom_method_name = '%s_create' % acquirer.provider if hasattr(self, custom_method_name): values.update(getattr(self, custom_method_name)(values)) - - return super(PaymentToken, self).create(values) + # remove all non-model fields used by (provider)_create method to avoid warning + fields_wl = set(self._fields.keys()) & set(values.keys()) + clean_vals = {field: values[field] for field in fields_wl} + return super(PaymentToken, self).create(clean_vals) @api.multi @api.depends('name') |
