Merge branch '12.0' into '12.0-test'

12.0

See merge request hibou-io/hibou-odoo/suite!1369
This commit is contained in:
Jared Kipe
2022-02-20 18:30:50 +00:00
2 changed files with 6 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError from odoo.exceptions import UserError, ValidationError
from .gls_nl_request import GLSNLRequest from .gls_nl_request import GLSNLRequest
from requests import HTTPError from requests import HTTPError
from base64 import decodebytes from base64 import decodebytes, b64decode
from csv import reader as csv_reader from csv import reader as csv_reader
@@ -261,7 +261,10 @@ class ProviderGLSNL(models.Model):
for i, unit in enumerate(label['units'], 1): for i, unit in enumerate(label['units'], 1):
trackings.append(unit['unitNo']) trackings.append(unit['unitNo'])
uniq_nos.append(unit['uniqueNo']) uniq_nos.append(unit['uniqueNo'])
attachments.append(('LabelGLSNL-%s-%s.%s' % (unit['unitNo'], i, sudoself.gls_nl_labeltype), unit['label'])) label_data = unit['label']
if label_data and sudoself.gls_nl_labeltype == 'pdf':
label_data = b64decode(label_data)
attachments.append(('LabelGLSNL-%s-%s.%s' % (unit['unitNo'], i, sudoself.gls_nl_labeltype), label_data))
tracking = ', '.join(set(trackings)) tracking = ', '.join(set(trackings))
logmessage = _("Shipment created into GLS NL<br/>" logmessage = _("Shipment created into GLS NL<br/>"

View File

@@ -34,6 +34,7 @@ class StockPicking(models.Model):
_inherit = 'stock.picking' _inherit = 'stock.picking'
shipping_account_id = fields.Many2one('partner.shipping.account', string='Shipping Account') shipping_account_id = fields.Many2one('partner.shipping.account', string='Shipping Account')
commercial_partner_id = fields.Many2one('res.partner', related='partner_id.commercial_partner_id')
require_insurance = fields.Selection([ require_insurance = fields.Selection([
('auto', 'Automatic'), ('auto', 'Automatic'),
('yes', 'Yes'), ('yes', 'Yes'),