You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// CleanupIncompleteRecords looks for partner records in Odoo that still have the "inflight" flag set despite being older than `minAge`. Those records are then deleted.
295
+
// Such records might come into existence due to a partially failed creation request.
282
296
l:=klog.FromContext(ctx)
283
297
l.Info("Looking for stale inflight partner records...")
284
298
@@ -298,9 +312,9 @@ func (s *Odoo8Storage) CleanupIncompleteRecords(ctx context.Context, minAge time
298
312
ids:= []int{}
299
313
300
314
for_, record:=rangeinflightRecords {
301
-
updateTime:=record.CreationTimestamp.ToTime()
315
+
createdTime:=record.CreationTimestamp.ToTime()
302
316
303
-
ifupdateTime.Before(time.Now().Add(-1*minAge)) {
317
+
ifcreatedTime.Before(time.Now().Add(-1*minAge)) {
304
318
ids=append(ids, record.ID)
305
319
l.Info("Preparing to delete inflight partner record", "name", record.Name, "id", record.ID)
odooUrl:=cmd.Flags().String("billing-entity-odoo8-url", "http://localhost:8069", "URL of the Odoo instance to use for billing entities")
22
21
debugTransport:=cmd.Flags().Bool("billing-entity-odoo8-debug-transport", false, "Enable debug logging for the Odoo transport")
23
-
countryList:=cmd.Flags().String("billing-entity-odoo8-country-list", "countries.yaml", "Path to the country list file in the format of [{name: \"Germany\", code: \"DE\", id: 81},...]")
24
-
accountingContactDisplayName:=cmd.Flags().String("billing-entity-odoo8-accounting-contact-display-name", "Accounting", "Display name of the accounting contact")
25
-
languagePreference:=cmd.Flags().String("billing-entity-odoo8-language-preference", "en_US", "Language preference of the Odoo record")
26
-
paymentTerm:=cmd.Flags().Int("billing-entity-odoo8-payment-term-id", 2, "Payment term ID of the Odoo record")
27
22
minAge:=cmd.Flags().Duration("billing-entity-odoo8-cleanup-after", time.Hour, "Clean up only records older than this")
0 commit comments