Skip to content

Commit 97c8914

Browse files
committed
Fix
1 parent ab1f97b commit 97c8914

3 files changed

Lines changed: 7 additions & 10 deletions

File tree

landolfio/inventory/models/asset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ def save(self, *args, **kwargs):
246246
def get_asset_ledger_account_id(self):
247247
"""Get the appropriate ledger account ID based on margin status."""
248248
if self.is_margin_asset:
249-
return str(settings.MONEYBIRD_MARGIN_ASSETS_LEDGER_ACCOUNT_ID)
249+
return settings.MONEYBIRD_MARGIN_ASSETS_LEDGER_ACCOUNT_ID
250250
else:
251-
return str(settings.MONEYBIRD_NOT_MARGIN_ASSETS_LEDGER_ACCOUNT_ID)
251+
return settings.MONEYBIRD_NOT_MARGIN_ASSETS_LEDGER_ACCOUNT_ID
252252

253253
def refresh_from_moneybird(self):
254254
"""Refresh asset data from Moneybird API if moneybird_asset_id is set."""
@@ -365,7 +365,7 @@ def create_on_moneybird(self):
365365

366366
moneybird_data = mb.create_asset(
367367
name=asset_name,
368-
ledger_account_id=int(ledger_account_id),
368+
ledger_account_id=ledger_account_id,
369369
purchase_value=float(self.purchase_value_asset),
370370
start_date=start_date_str,
371371
)

landolfio/website/settings/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,11 @@
259259
MONEYBIRD_AUTO_PUSH = True
260260
MONEYBIRD_FETCH_BEFORE_PUSH = False
261261

262-
MONEYBIRD_MARGIN_ASSETS_LEDGER_ACCOUNT_ID = os.environ.get(
263-
"MONEYBIRD_MARGIN_ASSETS_LEDGER_ACCOUNT_ID"
262+
MONEYBIRD_MARGIN_ASSETS_LEDGER_ACCOUNT_ID = str(
263+
os.environ.get("MONEYBIRD_MARGIN_ASSETS_LEDGER_ACCOUNT_ID")
264264
)
265-
MONEYBIRD_NOT_MARGIN_ASSETS_LEDGER_ACCOUNT_ID = os.environ.get(
266-
"MONEYBIRD_NOT_MARGIN_ASSETS_LEDGER_ACCOUNT_ID"
265+
MONEYBIRD_NOT_MARGIN_ASSETS_LEDGER_ACCOUNT_ID = str(
266+
os.environ.get("MONEYBIRD_NOT_MARGIN_ASSETS_LEDGER_ACCOUNT_ID")
267267
)
268268

269269
NINOX_API_TOKEN = os.environ.get("NINOX_API_TOKEN")

landolfio/website/settings/development.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,4 @@
5555
MEDIA_ROOT = BASE_DIR / "media"
5656
MEDIA_URL = "/media/"
5757

58-
MONEYBIRD_MARGIN_ASSETS_LEDGER_ACCOUNT_ID = "340246234795083709"
59-
MONEYBIRD_NOT_MARGIN_ASSETS_LEDGER_ACCOUNT_ID = "340246538381952245"
60-
6158
AUTO_CREATE_ASSET_ON_MONEYBIRD = True

0 commit comments

Comments
 (0)