lambda-erp 1.4.35__tar.gz → 1.4.37__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/PKG-INFO +1 -1
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/attachments.py +42 -1
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/llm_provider.py +14 -1
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/stock/consignment.py +3 -3
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/pyproject.toml +1 -1
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/.gitignore +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/LICENSE +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/README.md +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/__init__.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/auth.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/bootstrap.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/chat.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/chat_links.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/demo_limits.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/deps.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/erp_context.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/errors.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/list_columns.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/list_values.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/mail.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/main.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/mcp_oauth.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/mentions.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/menu_layout.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/number_series.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/oauth.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/order_actions.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/pdf.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/pdf_contract.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/pdf_exports.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/pdf_fonts.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/pdf_pages.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/pdf_profiles.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/pdf_templates.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/pricing_actions.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/providers.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/record_attachments.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/record_notes.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/remarks_md.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/__init__.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/accounting.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/actions.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/admin.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/analytics.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/availability.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/bank_reconciliation.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/bank_statements.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/chat_api.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/documents.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/masters.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/mcp.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/pdf_templates.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/proposals.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/reports.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/routers/setup.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/services.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/stock_actions.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/templates/_proposal_totals.html +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/templates/_record_base.html +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/templates/delivery_note.html +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/templates/document.html +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/templates/proposal.html +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/templates/record.html +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/templates/reservation.html +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/time_filters.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/tool_permissions.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/tool_results.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/api/write_context.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/docs/agents/README.md +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/frontend/LICENSE +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/frontend/README.md +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/frontend/src/api/client.ts +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/__init__.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/__init__.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/bank_account.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/bank_reconciliation.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/bank_statement_import.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/bank_transaction.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/budget.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/camt.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/chart_of_accounts.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/general_ledger.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/journal_entry.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/payment_entry.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/pos_invoice.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/purchase_invoice.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/revaluation.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/sales_invoice.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/settlement.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/setup/__init__.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/setup/engine.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/setup/pack.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/setup/packs/__init__.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/setup/packs/ch.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/setup/packs/de_common.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/setup/packs/de_skr03.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/setup/packs/de_skr04.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/setup/packs/generic.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/setup/profiles.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/setup/spine.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/accounting/subscription.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/addresses.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/assets/__init__.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/assets/asset.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/assets/lifecycle.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/assets/reservation.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/backlog.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/bundles.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/buying/__init__.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/buying/purchase_order.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/controllers/__init__.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/controllers/currency.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/controllers/defaults.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/controllers/item_price.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/controllers/item_prices.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/controllers/price_resolution.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/controllers/pricing_rule.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/controllers/tax_defaults.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/controllers/taxes_and_totals.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/customer_terms.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/database.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/exceptions.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/hooks.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/master_integrity.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/model.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/order_closing.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/permissions.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/selling/__init__.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/selling/proposal.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/selling/quotation.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/selling/sales_order.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/simulation.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/stock/__init__.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/stock/delivery_note.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/stock/purchase_receipt.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/stock/reservation.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/stock/serial.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/stock/stock_count.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/stock/stock_entry.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/stock/stock_ledger.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/timestamps.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/units.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/utils.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/validation.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/lambda_erp/workflow.py +0 -0
- {lambda_erp-1.4.35 → lambda_erp-1.4.37}/terraform/README.md +0 -0
|
@@ -61,10 +61,15 @@ STRUCTURED_TOOL_MIME_TYPES = {
|
|
|
61
61
|
# a one-line description, never the bytes.
|
|
62
62
|
FONT_MIME_TYPES = {"font/ttf", "font/otf", "font/woff", "font/woff2"}
|
|
63
63
|
|
|
64
|
+
# E-mail files (.eml). The model gets the headers, the readable text and the
|
|
65
|
+
# list of attached files, never the raw MIME source with its encoded parts.
|
|
66
|
+
EMAIL_MIME_TYPES = {"message/rfc822"}
|
|
67
|
+
EMAIL_TEXT_LIMIT = 50_000
|
|
68
|
+
|
|
64
69
|
ALLOWED_MIME_TYPES = {
|
|
65
70
|
"image/png", "image/jpeg", "image/gif", "image/webp",
|
|
66
71
|
"application/pdf",
|
|
67
|
-
} | OFFICE_MIME_TYPES | TEXT_MIME_TYPES | STRUCTURED_TOOL_MIME_TYPES | FONT_MIME_TYPES
|
|
72
|
+
} | OFFICE_MIME_TYPES | TEXT_MIME_TYPES | STRUCTURED_TOOL_MIME_TYPES | FONT_MIME_TYPES | EMAIL_MIME_TYPES
|
|
68
73
|
|
|
69
74
|
# Extension -> canonical mime, so a correctly-named file still uploads when the
|
|
70
75
|
# browser/OS mislabels its type (Office files are frequently sent as
|
|
@@ -87,6 +92,7 @@ _EXT_TO_MIME = {
|
|
|
87
92
|
"png": "image/png", "jpg": "image/jpeg", "jpeg": "image/jpeg",
|
|
88
93
|
"gif": "image/gif", "webp": "image/webp",
|
|
89
94
|
"ttf": "font/ttf", "otf": "font/otf", "woff": "font/woff", "woff2": "font/woff2",
|
|
95
|
+
"eml": "message/rfc822",
|
|
90
96
|
}
|
|
91
97
|
_MIME_TO_EXT = {m: e for e, m in _EXT_TO_MIME.items()}
|
|
92
98
|
|
|
@@ -435,6 +441,8 @@ def build_multimodal_content(attachment: dict) -> dict:
|
|
|
435
441
|
return {"type": "text", "text": (
|
|
436
442
|
f"[Font file: {filename} ({what}; id {attachment['id']}). To print a PDF template with it, "
|
|
437
443
|
"call add_attachment_to_pdf_template with this attachment id.]")}
|
|
444
|
+
if mime in EMAIL_MIME_TYPES:
|
|
445
|
+
return {"type": "text", "text": email_summary(attachment)}
|
|
438
446
|
if mime in TEXT_MIME_TYPES or mime.startswith("text/"):
|
|
439
447
|
text = attachment["data"].decode("utf-8", errors="replace")
|
|
440
448
|
return {"type": "text", "text": f"[File: {filename}]\n{text}"}
|
|
@@ -465,6 +473,39 @@ def build_multimodal_content(attachment: dict) -> dict:
|
|
|
465
473
|
return {"type": "text", "text": f"[Unsupported attachment: {filename}]"}
|
|
466
474
|
|
|
467
475
|
|
|
476
|
+
def email_summary(attachment: dict) -> str:
|
|
477
|
+
"""Readable form of an .eml attachment: headers, text body and attached files."""
|
|
478
|
+
import html as html_module
|
|
479
|
+
import re
|
|
480
|
+
from email import policy
|
|
481
|
+
from email.parser import BytesParser
|
|
482
|
+
|
|
483
|
+
message = BytesParser(policy=policy.default).parsebytes(attachment["data"])
|
|
484
|
+
head = [f"{key}: {message[key]}" for key in ("From", "To", "Cc", "Date", "Subject", "Message-ID") if message[key]]
|
|
485
|
+
body = message.get_body(preferencelist=("plain", "html"))
|
|
486
|
+
text = ""
|
|
487
|
+
if body is not None:
|
|
488
|
+
try:
|
|
489
|
+
text = body.get_content()
|
|
490
|
+
except (LookupError, ValueError):
|
|
491
|
+
text = body.get_payload(decode=True).decode("utf-8", errors="replace") if body.get_payload(decode=True) else ""
|
|
492
|
+
if body.get_content_subtype() == "html":
|
|
493
|
+
text = re.sub(r"(?is)<(script|style)[^>]*>.*?</\1>", " ", text)
|
|
494
|
+
text = html_module.unescape(re.sub(r"(?s)<[^>]+>", " ", text))
|
|
495
|
+
text = re.sub(r"[ \t]+", " ", text)
|
|
496
|
+
files = []
|
|
497
|
+
for part in message.iter_attachments():
|
|
498
|
+
payload = part.get_payload(decode=True) or b""
|
|
499
|
+
files.append(f"- {part.get_filename() or '(ohne Namen)'} ({part.get_content_type()}, {len(payload)} Bytes"
|
|
500
|
+
+ (", inline" if part.get_content_disposition() == "inline" else "") + ")")
|
|
501
|
+
text = text.strip()
|
|
502
|
+
if len(text) > EMAIL_TEXT_LIMIT:
|
|
503
|
+
text = text[:EMAIL_TEXT_LIMIT] + "\n[… gekürzt]"
|
|
504
|
+
return (f"[E-mail file: {attachment['filename']} (attachment id {attachment.get('id', '?')})]\n"
|
|
505
|
+
+ "\n".join(head) + "\n\n" + (text or "(kein Text)")
|
|
506
|
+
+ ("\n\nAttached files (not shown here):\n" + "\n".join(files) if files else ""))
|
|
507
|
+
|
|
508
|
+
|
|
468
509
|
def list_session_attachments(session_id: str, user_id: str) -> list[dict]:
|
|
469
510
|
"""Return metadata (no data) for all attachments in a session."""
|
|
470
511
|
db = get_db()
|
|
@@ -78,13 +78,26 @@ def not_configured_message() -> str:
|
|
|
78
78
|
return f"{settings.key_variable} is not configured"
|
|
79
79
|
|
|
80
80
|
|
|
81
|
+
def _client_timeout(timeout):
|
|
82
|
+
"""The timeout in the type the installed OpenAI SDK expects.
|
|
83
|
+
|
|
84
|
+
Since openai 3.x the SDK runs on its own HTTP client (httpx2), and httpx2
|
|
85
|
+
2.17 rejects an ``httpx.Timeout``. ``openai.Timeout`` is always the SDK's
|
|
86
|
+
own type, so convert instead of depending on which httpx the SDK uses.
|
|
87
|
+
"""
|
|
88
|
+
import openai
|
|
89
|
+
if timeout is None or isinstance(timeout, (int, float, openai.Timeout)):
|
|
90
|
+
return timeout
|
|
91
|
+
return openai.Timeout(connect=timeout.connect, read=timeout.read, write=timeout.write, pool=timeout.pool)
|
|
92
|
+
|
|
93
|
+
|
|
81
94
|
def client_kwargs(timeout: httpx.Timeout, erp_user: Optional[str] = None) -> dict:
|
|
82
95
|
"""Keyword arguments for ``OpenAI(...)`` with the configured provider."""
|
|
83
96
|
settings = llm_settings()
|
|
84
97
|
headers = {}
|
|
85
98
|
if settings.provider == "lambda" and erp_user:
|
|
86
99
|
headers[ERP_USER_HEADER] = str(erp_user)[:100]
|
|
87
|
-
kwargs = {"api_key": settings.api_key, "timeout": timeout}
|
|
100
|
+
kwargs = {"api_key": settings.api_key, "timeout": _client_timeout(timeout)}
|
|
88
101
|
if settings.base_url:
|
|
89
102
|
kwargs["base_url"] = settings.base_url
|
|
90
103
|
if headers:
|
|
@@ -181,10 +181,10 @@ class ConsignmentWithdrawal(Document):
|
|
|
181
181
|
"""Bill and withdraw once, through one Sales Invoice."""
|
|
182
182
|
from lambda_erp.accounting.sales_invoice import SalesInvoice
|
|
183
183
|
|
|
184
|
+
# No remarks: they are the printed notes on the customer's invoice. The
|
|
185
|
+
# withdrawal keeps the link to its invoice (sales_invoice).
|
|
184
186
|
invoice = SalesInvoice(
|
|
185
|
-
customer=self.customer, company=self.company, posting_date=self.posting_date, update_stock=1
|
|
186
|
-
remarks=f"Consignment withdrawal {self.name}"
|
|
187
|
-
+ (f" ({self.external_reference})" if self._data.get("external_reference") else ""))
|
|
187
|
+
customer=self.customer, company=self.company, posting_date=self.posting_date, update_stock=1)
|
|
188
188
|
for row in self.get("items"):
|
|
189
189
|
line = _dict(item_code=row["item_code"], qty=flt(row["qty"]), warehouse=self.warehouse,
|
|
190
190
|
batch_no=row.get("batch_no") or None, location=row.get("location") or None,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|