Public release from ruodoo-project: 19.0 - 2026-11-01 22:52:25 UTC

This commit is contained in:
CI Publish Bot
2026-11-01 22:54:30 +00:00
commit 26250aa580
2492 changed files with 664277 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import base64
import datetime
import werkzeug
from odoo.http import request, route
from odoo.addons.portal.controllers.portal import CustomerPortal
class SaleControlPortal(CustomerPortal):
@route(['/my/closing_document'], type='http', auth='user', website=True)
def submit_closing_document(self, redirect=None, **post):
"""Приём закрывающего документа (скан) от клиента из портала."""
name = post.get('name')
invoice_id = post.get('invoice_id')
redirect_url = post.get('url') or '/my/invoices'
file_data = False
for uploaded in request.httprequest.files.getlist('image_1920'):
content = uploaded.read()
if content:
file_data = base64.b64encode(content)
if name and invoice_id and file_data:
request.env['doc.closeddoc'].sudo().create({
'name': name,
'date_doc': datetime.date.today(),
'invoice_id': int(invoice_id),
'channel': 'scan',
'file_inv': file_data,
})
return werkzeug.utils.redirect('/my/invoices')
return werkzeug.utils.redirect(redirect_url)