Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intuitive interface for creating Sync Links for Odoo records #394

Closed

Conversation

themreza
Copy link

@themreza themreza commented Feb 9, 2022

Related to #393

I initially thought about grouping links (mappings) on a per-project basis and used the relation field to store the sync.project ID.
The code for this prototype is available in the first commit.

However, it's more likely that a link is shared across projects and that a single project should be able to link with multiple external systems. The second commit is a prototype without the Record Mappings tab in the Sync Project. It only has the debug menu popup.

@themreza themreza changed the title added a per-project record mapping interface on top of sync.link Intuitive interface for creating Sync Links for Odoo records Feb 9, 2022
@themreza
Copy link
Author

themreza commented Feb 9, 2022

I've added the second commit which modifies the prototype so that it is compatible with the current record.set_link method.

extref.mp4
OC_CATEGORY_REL = 'opencart_butopea_category'

def handle_button():
  odoo_website_category = env['product.public.category'].browse(1)
  opencart_category = odoo_website_category.search_links(OC_CATEGORY_REL)
Search links: [('relation', '=', 'opencart_butopea_category'), ('model', '=', 'product.public.category'), ('system1', '=', '__external__'), ('system2', '=', '__odoo__'), ('ref2', 'in', ['1'])] -> sync.link(34,)

@themreza themreza marked this pull request as ready for review February 9, 2022 15:42
@themreza
Copy link
Author

themreza commented Feb 9, 2022

I've added these changes in a new module, but if necessary we can embed them into existing source files.

@yelizariev
Copy link
Collaborator

@themreza don't hesitate to make the changes directly in sync module. It would be easier to maintain. Thank you for your contribution!

@yelizariev
Copy link
Collaborator

v14 is not supported. Target v16 instead.
I close this PR, but the code still might be useful to create the feature in newer versions

@yelizariev yelizariev closed this Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants