Skip to content

TA#83757 [14.0][FIX] delivery_custom_notification : multiple fixes#245

Merged
qtiplb merged 1 commit into
14.0from
14.0-delivery_custom_notification_fixes
Jun 16, 2026
Merged

TA#83757 [14.0][FIX] delivery_custom_notification : multiple fixes#245
qtiplb merged 1 commit into
14.0from
14.0-delivery_custom_notification_fixes

Conversation

@qtiplb

@qtiplb qtiplb commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes 4 issues reported after initial deployment of the delivery_custom_notification module.


✅ Fix 1: Use Native Contact Type System

Problem: Custom boolean field is_delivery_contact was inconsistent with Odoo's standard contact typing system.

Solution:

  • Removed custom is_delivery_contact boolean field
  • Extended native type selection field with new "Delivery Contact" option
  • Updated domain: [('type', '=', 'delivery_contact')]
  • Now appears in the same Type dropdown as "Invoice Address", "Delivery Address", etc.

Benefits:

  • Consistent with Odoo UX patterns
  • Users already familiar with contact types
  • Cleaner data model

✅ Fix 2: Field Positioning

Problem: delivery_contact_id field was in the Misc section, far from related delivery fields.

Solution:

  • Positioned field directly after property_delivery_carrier_id (Delivery Method)
  • Changed from xpath to direct field positioning

Benefits:

  • Logically grouped with delivery configuration
  • Better UX flow

✅ Fix 3: Filter Positioning

Problem: "Delivery Contacts" filter was inside the Customer/Supplier/Invoice section.

Solution:

  • Added <separator/> before the filter
  • Creates a distinct section separate from Customer/Supplier filters

Benefits:

  • Clear visual separation
  • Proper filter organization

✅ Fix 4: PICK Operations Triggering Notifications

Problem: PICK operations with manually added carriers triggered super()._send_confirmation_email(), causing unwanted chatter messages.

Solution:

  • Added filter on remaining_pickings: lambda p: p.picking_type_id.code == 'outgoing'
  • Only WH/OUT deliveries now call super()

Benefits:

  • PICK/PACK operations no longer trigger notifications
  • Cleaner chatter on internal operations

🇫🇷 Bonus: French Translations

  • Added complete i18n/fr.po file
  • All module strings translated
  • Includes field labels, help texts, and UI messages

Technical Changes

Modified Files:

  • models/res_partner.py: Replaced boolean with Selection extension
  • views/res_partner_views.xml: Updated field positioning and filter section
  • models/stock_picking.py: Added filtering for super() call
  • i18n/fr.po: New French translation file (NEW)
  • README.rst: Updated documentation

Stats: 5 files changed, 132 insertions(+), 41 deletions(-)


📝 Note on Email Recipients

The module uses message_post_with_template() with partner_ids parameter.

Important: Email templates should have recipient fields empty (To, CC, Partner IDs). The module sets recipients programmatically. If templates have preconfigured recipients, duplicates may occur.

This is documented in README with ⚠️ CRITICAL warnings.

* Use native type field instead of custom boolean (is_delivery_contact)
* Add 'delivery_contact' as new partner type option
* Position delivery_contact_id field after property_delivery_carrier_id
* Add separator before filter to create distinct section
* Add French translations (i18n/fr.po)
* Fix PICK operations triggering super() call unnecessarily
* Update domain and context to use type='delivery_contact'
* Remove custom field view, now uses standard Odoo type selector
* Update README to reflect type system usage
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@qtiplb
qtiplb merged commit 8eeb7e6 into 14.0 Jun 16, 2026
2 of 4 checks passed
@qtiplb
qtiplb deleted the 14.0-delivery_custom_notification_fixes branch June 16, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant