mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
Add api decorator on create, write
on pingen ir.attachment. When multiple module redefine create, write it can lead to TypeError
This commit is contained in:
committed by
Anna Janiszewska
parent
458a1d5f11
commit
789f5ddeee
@@ -6,7 +6,7 @@
|
||||
import requests
|
||||
import base64
|
||||
|
||||
from odoo import models, fields, _
|
||||
from odoo import models, fields, _, api
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
@@ -66,12 +66,14 @@ class IrAttachment(models.Model):
|
||||
document.write({'state': 'canceled'})
|
||||
return
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
attachment = super(IrAttachment, self).create(vals)
|
||||
if 'send_to_pingen' in vals:
|
||||
attachment._handle_pingen_document()
|
||||
return attachment
|
||||
|
||||
@api.multi
|
||||
def write(self, vals):
|
||||
res = super(IrAttachment, self).write(vals)
|
||||
if 'send_to_pingen' in vals:
|
||||
|
||||
Reference in New Issue
Block a user