Pingen: API v2 changes

This commit is contained in:
Anna Janiszewska
2023-01-30 12:56:55 +01:00
parent 0529340243
commit b72b28f004
14 changed files with 814 additions and 304 deletions

View File

@@ -18,23 +18,12 @@ class IrAttachment(models.Model):
pingen_document_ids = fields.One2many(
"pingen.document", "attachment_id", string="Pingen Document", readonly=True
)
pingen_send = fields.Boolean(
"Send",
help="Defines if a document is merely uploaded or also sent",
default=True,
)
pingen_speed = fields.Selection(
[("1", "Priority"), ("2", "Economy")],
"Speed",
default="2",
help="Defines the sending speed if the document is automatically sent",
)
pingen_color = fields.Selection(
[("0", "B/W"), ("1", "Color")], "Type of print", default="0"
)
def _prepare_pingen_document_vals(self):
return {"attachment_id": self.id, "config": "created from attachment"}
return {
"attachment_id": self.id,
# 'config': 'created from attachment'
}
def _handle_pingen_document(self):
"""Reponsible of the related ``pingen.document``