[FIX] l10n_de: xmlrpc call can't get account.move
Current behaviour:
When making a xmlrpc call without fields using:
models.execute_kw(
db,
uid,
password,
'account.move',
'search_read',
[[['name', '=', "INV/2023/00001"]]])
the client receives a traceback ending with:
TypeError: cannot marshal<class \'odoo.api.res.partner\'> objects\n'>
Steps to reproduce:
1. install any of the l10n_de_... modules
2. Make a xmlrpc call like stated above
3. Traceback like stated above
Cause of the issue:
The field l10n_de_addresses is used to store
(_("Invoicing Address:"), record.partner_id)
Which isn't serialized correctly:
record.partner_id is not repr
(is python object instead of (6, 'something'))
Fix:
Applied a fix similar to https://github.com/odoo/odoo/commit/602b3f3d39db29fbcd90e3f734bdcc73e67f175d
opw-3248887
closes odoo/odoo#139095
X-original-commit: 46adfb32567ac364b5f3916f50ad47af4142163b
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Antoine Demany (ande) <ande@odoo.com>
Co-authored-by: Julien Castiaux <juc@odoo.com>
This commit is contained in:
co-authored by
Julien Castiaux
parent
0f5b362bae
commit
bb7b23b0be
@@ -7,7 +7,7 @@ class AccountMove(models.Model):
|
|||||||
|
|
||||||
l10n_din5008_template_data = fields.Binary(compute='_compute_l10n_din5008_template_data')
|
l10n_din5008_template_data = fields.Binary(compute='_compute_l10n_din5008_template_data')
|
||||||
l10n_din5008_document_title = fields.Char(compute='_compute_l10n_din5008_document_title')
|
l10n_din5008_document_title = fields.Char(compute='_compute_l10n_din5008_document_title')
|
||||||
l10n_din5008_addresses = fields.Binary(compute='_compute_l10n_din5008_addresses')
|
l10n_din5008_addresses = fields.Binary(compute='_compute_l10n_din5008_addresses', exportable=False)
|
||||||
|
|
||||||
def _compute_l10n_din5008_template_data(self):
|
def _compute_l10n_din5008_template_data(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -52,3 +52,9 @@ class AccountMove(models.Model):
|
|||||||
else:
|
else:
|
||||||
data.append((_("Shipping Address:"), record.partner_shipping_id))
|
data.append((_("Shipping Address:"), record.partner_shipping_id))
|
||||||
data.append((_("Invoicing Address:"), record.partner_id))
|
data.append((_("Invoicing Address:"), record.partner_id))
|
||||||
|
|
||||||
|
def check_field_access_rights(self, operation, field_names):
|
||||||
|
field_names = super().check_field_access_rights(operation, field_names)
|
||||||
|
return [field_name for field_name in field_names if field_name not in {
|
||||||
|
'l10n_din5008_addresses',
|
||||||
|
}]
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class PurchaseOrder(models.Model):
|
|||||||
|
|
||||||
l10n_din5008_template_data = fields.Binary(compute='_compute_l10n_din5008_template_data')
|
l10n_din5008_template_data = fields.Binary(compute='_compute_l10n_din5008_template_data')
|
||||||
l10n_din5008_document_title = fields.Char(compute='_compute_l10n_din5008_document_title')
|
l10n_din5008_document_title = fields.Char(compute='_compute_l10n_din5008_document_title')
|
||||||
l10n_din5008_addresses = fields.Binary(compute='_compute_l10n_din5008_addresses')
|
l10n_din5008_addresses = fields.Binary(compute='_compute_l10n_din5008_addresses', exportable=False)
|
||||||
|
|
||||||
def _compute_l10n_din5008_template_data(self):
|
def _compute_l10n_din5008_template_data(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -48,3 +48,9 @@ class PurchaseOrder(models.Model):
|
|||||||
data.append((_("Shipping Address:"), record.dest_address_id))
|
data.append((_("Shipping Address:"), record.dest_address_id))
|
||||||
elif 'picking_type_id' in record._fields and record.picking_type_id.warehouse_id:
|
elif 'picking_type_id' in record._fields and record.picking_type_id.warehouse_id:
|
||||||
data.append((_("Shipping Address:"), record.picking_type_id.warehouse_id.partner_id))
|
data.append((_("Shipping Address:"), record.picking_type_id.warehouse_id.partner_id))
|
||||||
|
|
||||||
|
def check_field_access_rights(self, operation, field_names):
|
||||||
|
field_names = super().check_field_access_rights(operation, field_names)
|
||||||
|
return [field_name for field_name in field_names if field_name not in {
|
||||||
|
'l10n_din5008_addresses',
|
||||||
|
}]
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class SaleOrder(models.Model):
|
|||||||
|
|
||||||
l10n_din5008_template_data = fields.Binary(compute='_compute_l10n_din5008_template_data')
|
l10n_din5008_template_data = fields.Binary(compute='_compute_l10n_din5008_template_data')
|
||||||
l10n_din5008_document_title = fields.Char(compute='_compute_l10n_din5008_document_title')
|
l10n_din5008_document_title = fields.Char(compute='_compute_l10n_din5008_document_title')
|
||||||
l10n_din5008_addresses = fields.Binary(compute='_compute_l10n_din5008_addresses')
|
l10n_din5008_addresses = fields.Binary(compute='_compute_l10n_din5008_addresses', exportable=False)
|
||||||
|
|
||||||
def _compute_l10n_din5008_template_data(self):
|
def _compute_l10n_din5008_template_data(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -48,3 +48,9 @@ class SaleOrder(models.Model):
|
|||||||
else:
|
else:
|
||||||
data.append((_("Shipping Address:"), record.partner_shipping_id))
|
data.append((_("Shipping Address:"), record.partner_shipping_id))
|
||||||
data.append((_("Invoicing Address:"), record.partner_invoice_id))
|
data.append((_("Invoicing Address:"), record.partner_invoice_id))
|
||||||
|
|
||||||
|
def check_field_access_rights(self, operation, field_names):
|
||||||
|
field_names = super().check_field_access_rights(operation, field_names)
|
||||||
|
return [field_name for field_name in field_names if field_name not in {
|
||||||
|
'l10n_din5008_addresses',
|
||||||
|
}]
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from odoo.tools import format_date
|
|||||||
class StockPicking(models.Model):
|
class StockPicking(models.Model):
|
||||||
_inherit = 'stock.picking'
|
_inherit = 'stock.picking'
|
||||||
|
|
||||||
l10n_din5008_addresses = fields.Binary(compute='_compute_l10n_din5008_addresses')
|
l10n_din5008_addresses = fields.Binary(compute='_compute_l10n_din5008_addresses', exportable=False)
|
||||||
|
|
||||||
def _compute_l10n_din5008_addresses(self):
|
def _compute_l10n_din5008_addresses(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -18,3 +18,9 @@ class StockPicking(models.Model):
|
|||||||
if record.picking_type_id.code == 'outgoing' and record.move_ids_without_package and record.move_ids_without_package[0].partner_id \
|
if record.picking_type_id.code == 'outgoing' and record.move_ids_without_package and record.move_ids_without_package[0].partner_id \
|
||||||
and record.move_ids_without_package[0].partner_id.id != record.partner_id.id:
|
and record.move_ids_without_package[0].partner_id.id != record.partner_id.id:
|
||||||
data.append((_('Customer Address:'), record.partner_id))
|
data.append((_('Customer Address:'), record.partner_id))
|
||||||
|
|
||||||
|
def check_field_access_rights(self, operation, field_names):
|
||||||
|
field_names = super().check_field_access_rights(operation, field_names)
|
||||||
|
return [field_name for field_name in field_names if field_name not in {
|
||||||
|
'l10n_din5008_addresses',
|
||||||
|
}]
|
||||||
|
|||||||
Reference in New Issue
Block a user