Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: honor delta from query param #13

Open
wants to merge 3 commits into
base: 14.0
Choose a base branch
from
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 frepple/controllers/frepplexml.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def xml(self, **kwargs):
company=company_name,
mode=int(kwargs.get("mode", 1)),
timezone=kwargs.get("timezone", None),
delta=int(kwargs.get("delta", 999)),
singlecompany=kwargs.get("singlecompany", "false").lower()
== "true",
version=version,
Expand Down
17 changes: 9 additions & 8 deletions frepple/controllers/outbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ def getData(self, model, search=[], order=None, fields=[], ids=None):
if ids is not None:
return self.env[model].browse(ids).read(fields) if ids else []
if order:
return self.env[model].search(search, order=order).read(fields)
return self.env[model].search_read(
domain=search, order=order, fields=fields)
else:
return self.env[model].search(search).read(fields)
return self.env[model].search_read(domain=search, fields=fields)


class XMLRPC_generator:
Expand Down Expand Up @@ -661,7 +662,7 @@ def export_customers(self):
first = True
for i in self.generator.getData(
"res.partner",
search=[("is_company", "=", True)],
search=[("customer_rank", ">", 0)],
fields=["name"],
):
if first:
Expand All @@ -685,7 +686,7 @@ def export_suppliers(self):
first = True
for i in self.generator.getData(
"res.partner",
search=[("is_company", "=", True)],
search=[("supplier_rank", ">", "0")],
fields=["name"],
):
if first:
Expand Down Expand Up @@ -1594,10 +1595,10 @@ def export_salesorders(self):
else "%s %d %d" % (i["order_id"][1], cnt, i["id"])
),
quoteattr(batch),
qty,
odoo.tools.float_round(qty,8) if odoo.tools.float_round(qty,8) > 0 else 0,
due,
priority,
j["picking_policy"] == "one" and qty or 0.0,
j["picking_policy"] == "one" and (odoo.tools.float_round(qty,8) if odoo.tools.float_round(qty,8) > 0 else 0) or 0.0,
status,
quoteattr(product["name"]),
quoteattr(customer),
Expand All @@ -1617,10 +1618,10 @@ def export_salesorders(self):
) % (
quoteattr(name),
quoteattr(batch),
qty,
odoo.tools.float_round(qty,8) if odoo.tools.float_round(qty,8) > 0 else 0,
due,
priority,
j["picking_policy"] == "one" and qty or 0.0,
j["picking_policy"] == "one" and (odoo.tools.float_round(qty,8) if odoo.tools.float_round(qty,8) > 0 else 0) or 0.0,
status,
quoteattr(product["name"]),
quoteattr(customer),
Expand Down