Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions connector_lighting_sapb1/components/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def _format_lighting_product(self, data):
conv_mapper = {
"/SWeight1": lambda x: float(x) or float(0),
"/SVolume": lambda x: float(x) or float(0),
"/SVolUnit": lambda x: int(x) if x is not None else None,
"/SLength1": lambda x: float(x) or float(0),
"/SWidth1": lambda x: float(x) or float(0),
"/SHeight1": lambda x: float(x) or float(0),
Expand Down
5 changes: 3 additions & 2 deletions connector_lighting_sapb1/models/lighting_product/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ class LightingSAPB1ProductAdapter(Component):
g."ItmsGrpCod", g."ItmsGrpNam", p."U_U_familia",
p."U_U_aplicacion",p."U_ACC_Obsmark",
p."U_U_Configurador", p."U_U_FECHACAT",
p."SWeight1", p."SVolume", p."SLength1",
p."SWidth1", p."SHeight1", s."OnHand",
p."SWeight1", p."SVolume", p."SVolUnit",
p."SLength1", p."SWidth1", p."SHeight1", s."OnHand",
s."IsCommited", s."OnOrder", s."ShipDate",
s."Capacity", p."AvgPrice", p."LastPurDat",
COALESCE(pp."PurchasePrice", 0)
Expand Down Expand Up @@ -178,6 +178,7 @@ class LightingSAPB1ProductAdapter(Component):
COALESCE(to_binary(p."U_U_FECHACAT"), '00'), '00',
COALESCE(to_binary(p."SWeight1"), '00'), '00',
COALESCE(to_binary(p."SVolume"), '00'), '00',
COALESCE(to_binary(p."SVolUnit"), '00'), '00',
COALESCE(to_binary(p."SLength1"), '00'), '00',
COALESCE(to_binary(p."SWidth1"), '00'), '00',
COALESCE(to_binary(p."SHeight1"), '00'), '00',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ def dimensions(self, record):
if not binding or not binding.ibox_weight:
values["ibox_weight"] = record["SWeight1"]
if not binding or not binding.ibox_volume:
values["ibox_volume"] = record["SVolume"] * 1000
if record["SVolUnit"] == 3:
values["ibox_volume"] = record["SVolume"] * 1000
else:
values["ibox_volume"] = record["SVolume"]
if not binding or not binding.ibox_length:
values["ibox_length"] = record["SLength1"]
if not binding or not binding.ibox_width:
Expand Down
Loading