forked from OdooDataFlow/odoo-data-flow
-
Notifications
You must be signed in to change notification settings - Fork 1
Task 3.1: Create odf\_conflict\_resolution Module* #7
Copy link
Copy link
Open
Description
Task 3.1: Create odf_conflict_resolution Module
Goal: Build the user interface in Odoo for managing and resolving true data conflicts.
Prompt for AI Coding Agent:
Context:
You are to build the odf_conflict_resolution Odoo module, which is the final piece of the 3-Way Merge strategy outlined in the Project Constitution (section 4.3). This module will allow users to resolve data conflicts that the "Safe Update" logic could not handle automatically.
Use the j-base branch
Requirements:
- Prerequisite: This module must add the x_odf_original_snapshot field (JSONB) to base models like res.partner and product.product.
- Conflict Model:
- Create a model odf.conflict. It should store:
- A link to the related_record (Reference field).
- field_name (e.g., 'phone').
- source_value (Text).
- destination_value (Text).
- final_value (Text, user-editable).
- status ('New', 'Resolved').
- Create a model odf.conflict. It should store:
- Conflict UI:
- Create a menu and views (list, form) for the odf.conflict model.
- The form view must clearly display the source and destination values and provide an editable field for the final_value.
- Include a "Resolve" button on the form. When clicked, this button's method should write the final_value to the correct field on the related_record and update the conflict's status to 'Resolved'.
- Dynamic Rules:
- Add a model odf.conflict.rule to store rules (e.g., model: res.partner, field: cost_price, resolution: always_source).
- Add a "Create Rule" button to the conflict form. When clicked, it should open a wizard that allows the user to create a rule based on the current conflict.
- Integration:
- Modify the odoo-data-flow logic (from Task 2.2). When it detects a conflict, instead of just logging it, it should now use the Odoo API to create a new odf.conflict record in the destination database. It must first check if a rule exists in odf.conflict.rule that would automatically resolve the conflict.
Deliverable:
Provide the complete Python and XML code for the odf_conflict_resolution Odoo module and indicate the necessary modifications to the odoo-data-flow conflict detection logic.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels