Skip to Content
CTech Digital
  • Home
  • Odoo services
  • AI services
  • Contact us
  • 0
  • Nederlands (BE) English (UK) Français
CTech Digital
  • 0
    • Home
    • Odoo services
    • AI services
    • Contact us
  • Nederlands (BE) English (UK) Français

28/4/2025

  • All Blogs
  • Daily blog
  • 28/4/2025
  • 28 April 2025 by
    CTech Metrology, Luc Wens

    First : when the logitech mouse is not response, check with a wired mouse first before starting to uninstall all kind of things.


    Second: regarding CTreeSyncrhonizer, I was kind of stuck on this, as I struggle with insert and move, which one do you do first. 

    Well, this is the wrong approach. What we need to do is work with sets or maps, make sure that in the target tree every node contains the same elements that are in the reference tree, and in a final step, sort everything according to the reference tree.

    Algorithm

    1. Remove all elements of Target and put them in a global map
      1. For this it is important that the identification string is strong enough, so combination of type / name / serial 
      2. => as a result we have an empty Target
    2. Recurse over Reference
      1. Create ID string
      2. Check if ID is in global map
        1. Yes : remove from map and add to current node of Target
        2. No : create a copy based on reference
    3. Everything which is still left in the global map was not found in Reference and can be deleted

    Example

    • Reference
      • A
        • B
        • C
      • D

    • Target
      • A
        • B
      • E
        • C

    Step 1 : Target is empty and we get {A,B,E,C} in the global map

    Step 2 :

    • Target
      • A
        • B
        • C
      • D

    and global map is {C}, element D was created as copy, the rest was taken out of the map

    Step 3 :

    Delete all elements in global map, which is C 


    Taking a global approach removes headaches about swap - insert conflicts, but it is important that the ID string is strong enough.


    in Daily blog
    Orange
    Copyright © CTech
    Nederlands (BE) | English (UK) | Français
    Powered by Odoo - The #1 Open Source eCommerce