[18.0][ADD] product_trade_compliance: Manage trade compliance codes#253
Open
bosd wants to merge 1 commit into
Open
[18.0][ADD] product_trade_compliance: Manage trade compliance codes#253bosd wants to merge 1 commit into
bosd wants to merge 1 commit into
Conversation
This module enables tracking of dual-use and export control codes for products in Odoo, supporting both US Export Administration Regulations (EAR) ECCN codes and EU Dual-Use Regulation codes. Features: - Manage multiple trade compliance regimes (US-EAR, EU-DUAL) - Define compliance codes with descriptions - Set default codes at product category level - Automatic inheritance from category to product - Related fields showing regime and code description - Search and filter by regime - Pre-loaded with 2,672 official compliance codes Data included: - EU: 2,652 codes from EU Dual-Use Regulation (EU) 2021/821 (Sept 2024) - US: 21 common ECCN codes from Commerce Control List Official sources: - EU: https://policy.trade.ec.europa.eu/help-exporters-and-importers/exporting-dual-use-items_en - US: https://www.ecfr.gov/current/title-15/part-774 Technical implementation: - Models: trade.compliance.regime, trade.compliance.code - Inherits: product.category, product.template - Data format: CSV for efficient bulk loading - Utility scripts for data refresh (scripts/) - Comprehensive test suite (10 tests) - Full OCA compliance (README, i18n, security)
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
Contributor
Author
|
please keep open |
rrebollo
approved these changes
Apr 30, 2026
Comment on lines
+44
to
+54
| for product in self: | ||
| if not product.compliance_code_id and category.compliance_code_id: | ||
| # Add compliance_code_id to vals for this specific product | ||
| if len(self) == 1: | ||
| # Single record update | ||
| vals["compliance_code_id"] = category.compliance_code_id.id | ||
| else: | ||
| # Multiple records - update individually | ||
| super(ProductTemplate, product).write( | ||
| {"compliance_code_id": category.compliance_code_id.id} | ||
| ) |
There was a problem hiding this comment.
Suggested change
| for product in self: | |
| if not product.compliance_code_id and category.compliance_code_id: | |
| # Add compliance_code_id to vals for this specific product | |
| if len(self) == 1: | |
| # Single record update | |
| vals["compliance_code_id"] = category.compliance_code_id.id | |
| else: | |
| # Multiple records - update individually | |
| super(ProductTemplate, product).write( | |
| {"compliance_code_id": category.compliance_code_id.id} | |
| ) | |
| if category.compliance_code_id: | |
| for product in self.filtered(lambda prod: not prod.compliance_code_id): | |
| # Add compliance_code_id to vals for this specific product | |
| if len(self) == 1: | |
| # Single record update | |
| vals["compliance_code_id"] = category.compliance_code_id.id | |
| else: | |
| # Multiple records - update individually | |
| product.compliance_code_id = category.compliance_code_id.id} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This module enables tracking of dual-use and export control codes for products in Odoo, supporting both US Export Administration Regulations (EAR) ECCN codes and EU Dual-Use Regulation codes.
Features:
Data included:
Official sources:
Technical implementation: