Skip to content

3.4.0

Choose a tag to compare

@PaulArgoud PaulArgoud released this 17 Feb 23:14
· 54 commits to main since this release

Added

  • Dokan module — New marketplace module for Dokan 3.7+. Syncs vendors → res.partner (bidirectional, supplier_rank=1), sub-orders → purchase.order (push), commissions → account.move (push, vendor bills via Odoo_Accounting_Formatter), withdrawals → account.payment (push). Exclusive group marketplace. Requires WooCommerce module
  • WCFM module — New marketplace module for WCFM Marketplace 6.5+. Syncs vendors → res.partner (bidirectional, supplier_rank=1), sub-orders → purchase.order (push), commissions → account.move (push, vendor bills), withdrawals → account.payment (push). Exclusive group marketplace. Requires WooCommerce module
  • WC Vendors module — New marketplace module for WC Vendors Pro 2.0+. Syncs vendors → res.partner (bidirectional, supplier_rank=1), sub-orders → purchase.order (push), commissions → account.move (push, vendor bills), payouts → account.payment (push). Exclusive group marketplace. Requires WooCommerce module
  • SureCart module — New e-commerce module for SureCart 2.0+. Syncs products → product.template (bidirectional), orders → sale.order (bidirectional), subscriptions → sale.subscription (push). Exclusive group ecommerce_alt
  • WC B2B module — New B2B/wholesale module for Wholesale Suite (WWP) 2.0+. Syncs company accounts → res.partner (bidirectional, is_company=true, payment terms, partner categories), pricelist rules → product.pricelist.item (push, wholesale pricing). Requires WooCommerce module
  • MailPoet module — New email marketing module for MailPoet 4.0+. Syncs subscribers → mailing.contact (bidirectional, M2M list_ids resolution), mailing lists → mailing.list (bidirectional). Dedup by email/name
  • Mailchimp for WP (MC4WP) module — New email marketing module for MC4WP 4.8+. Syncs subscribers → mailing.contact (bidirectional, M2M list_ids resolution), lists → mailing.list (bidirectional). Hooks into mc4wp_form_subscribed and mc4wp_integration_subscribed. Dedup by email/name
  • JetAppointments module — New booking module for JetAppointments (Crocoblock) 1.0+. Extends Booking_Module_Base. Syncs services → product.product (bidirectional), appointments → calendar.event (push). CPT-based data access (jet-appointment, jet-service). Hooks: jet-apb/db/appointment/after-insert, jet-apb/db/appointment/after-update, save_post_{service_cpt}
  • WP Project Manager module — New project management module for WP Project Manager (weDevs) 2.0+. Syncs projects → project.project (bidirectional), tasks → project.task (bidirectional), timesheets → account.analytic.line (push). Custom table access (cpm_projects, cpm_tasks). Employee resolution via hr.employee lookup. Dependency cascade: tasks require project synced first
  • WC Product Add-Ons module — New product add-ons module supporting WooCommerce Product Add-Ons (official 6.0+), ThemeHigh THWEPO, and PPOM. Push-only with dual mode: product_attributes (add-ons → product.template.attribute.line) or bom_components (add-ons → mrp.bom). Multi-plugin abstraction layer auto-detects active plugin. Cross-module entity_map for parent product resolution
  • JetEngine module — New generic CPT sync module for JetEngine (Crocoblock) 3.0+. Push-only with admin-configured CPT → Odoo model mappings. Dynamic entity types populated from cpt_mappings settings at runtime. Unified field reader: standard post fields, meta:, jet:, tax: prefixes. 8 type conversions. Per-mapping dedup field. PHP filter hooks for customization
  • Odoo_Model enum additions — 11 new cases: MailingContact, MailingList, PurchaseOrder, AccountPaymentTerm, PartnerCategory, ProductCategory, ProjectProject, AccountAnalyticLine, ProductAttribute, ProductAttributeValue, ProductTemplateAttributeLine
  • Queue depth alertingQueue_Manager monitors pending job count and fires wp4odoo_queue_depth_warning (≥ 1 000 jobs) and wp4odoo_queue_depth_critical (≥ 5 000 jobs) action hooks with a 5-minute cooldown between alerts. Consumers can use these to trigger admin notices, email alerts, or pause enqueuing
  • Queue_Job readonly DTO — New Queue_Job readonly class provides typed, immutable access to sync queue job data (id, module, entity_type, action, wp_id, odoo_id, status, retry_count, error_message, created_at, scheduled_at, claimed_at). Sync_Queue_Repository::fetch_pending() now returns Queue_Job[] instead of raw stdClass arrays
  • Advisory_Lock utility class — Reusable MySQL advisory lock wrapper (acquire(), release(), is_held()) consolidating 3 duplicate implementations across Sync_Engine, Partner_Service, and Push_Lock

Changed

  • Queue_Manager injectableQueue_Manager is now instantiable with an optional Sync_Queue_Repository dependency. Module_Base exposes queue() accessor and set_queue_manager() setter. Module push/pull operations use the injectable instance. Static API preserved for backward compatibility
  • Chunked DELETE in cleanupSync_Queue_Repository::cleanup() and Logger::cleanup() now delete in chunks of 10 000 rows to avoid long-running table locks on large sites
  • CLI i18n — 42+ WP_CLI::log() / WP_CLI::success() / WP_CLI::error() strings across CLI, CLI_Queue_Commands, and CLI_Module_Commands wrapped in __() for translation support
  • Injectable transport for Odoo_ClientOdoo_Client constructor now accepts optional ?Transport and ?Settings_Repository parameters, enabling test doubles without monkey-patching and improving DI testability
  • Standardized Logger constructionLogger now consistently receives Settings_Repository across all construction sites (Odoo_Client, Translation_Service, Ajax_Monitor_Handlers), eliminating bare new Logger() calls
  • Webhook_Handler dependency injectionWebhook_Handler now receives Module_Registry via constructor instead of resolving the plugin singleton internally
  • Advisory lock on batch createspush_batch_creates() acquires a per-model advisory lock (wp4odoo_batch_{module}_{model}) to prevent concurrent batch creates from producing duplicates
  • Settings write-time validationSettings_Repository gains save_sync_settings() and save_log_settings() with enum validation (protocol, direction, log level) and numeric range clamping (timeout 5–120, batch_size 1–500)
  • Rate_Limiter atomic increment — Dual-strategy rate limiting: wp_cache_incr() for sites with Redis/Memcached (atomic, no TOCTOU), transient fallback for standard installs
  • Module_Helpers trait split — Split Module_Helpers into 4 focused sub-traits: Partner_Helpers, Accounting_Helpers, Dependency_Helpers, Sync_Helpers. Module_Helpers now composes all 4 via use for backward compatibility

Fixed

  • Exclusive group priority bugModule_Registry::has_booted_in_group() now blocks any module in the same exclusive group regardless of priority (first-registered wins), fixing a bug where higher-priority modules could bypass exclusion

Refactored

  • Settings_Repository helpers — Extracted get_bool_option() / set_bool_option() / get_int_option() / set_int_option() private helpers, reducing 8 getter/setter pairs to one-liner delegations
  • Form_Field_Extractor — Extracted 7 extract_from_* methods from Form_Handler (514 → 97 LOC) into a strategy-based Form_Field_Extractor class with registered closures per form plugin
  • WC_Translation_Accumulator — Extracted translation accumulation logic from WC_Pull_Coordinator (723 → 520 LOC) into a focused WC_Translation_Accumulator class (289 LOC)
  • Translation strategies — Extracted Odoo version-specific push/pull logic from Translation_Service (768 → 629 LOC) into Translation_Strategy_Modern (Odoo 16+) and Translation_Strategy_Legacy (Odoo 14–15) behind a Translation_Strategy interface
  • Sync_Orchestrator trait — Extracted push_to_odoo(), push_batch_creates(), and pull_from_odoo() from Module_Base (1 245 → 921 LOC) into a Sync_Orchestrator trait (344 LOC)
  • Batch_Create_Processor — Extracted batch create pipeline from Sync_Engine (811 → 731 LOC) into a dedicated Batch_Create_Processor class (208 LOC) with injected dependencies
  • Test base classes — Extracted MembershipModuleTestBase (30 shared tests) and LMSModuleTestBase (29 shared tests) abstract classes, reducing 6 module test files by ~580 lines total

Tests

  • 4 051 unit tests (6 210 assertions) — new tests covering 11 new modules (Dokan, WCFM, WC Vendors, SureCart, WC B2B, MailPoet, MC4WP, JetAppointments, WP Project Manager, WC Product Add-Ons, JetEngine), Queue_Job DTO, advisory locks, Queue_Manager DI, queue depth alerting, chunked cleanup, settings validation, rate limiter, and module registry fixes