OpenUpgrade icon indicating copy to clipboard operation
OpenUpgrade copied to clipboard

[17.0][OU-ADD] analytic: migration to 17.0

Open daiduongnguyen-odoo opened this issue 1 year ago • 3 comments

daiduongnguyen-odoo avatar Jun 13 '24 06:06 daiduongnguyen-odoo

/ocabot migration analytic

pedrobaeza avatar Jun 13 '24 06:06 pedrobaeza

Hi @duong77476-viindoo ,

First of all, thank you for the work you've done on this pull request. While testing in my environment, I encountered a small issue related to property creation in the post-migration file, specifically on line 66.

The problem seemed to be that some properties already existed, causing an error when trying to recreate them. I suggest a solution to check if the property exists before creating it. The fix I applied is as follows:

  if vals_list:
      for vals in vals_list:
          property = env['ir.property'].search([('fields_id', '=', vals['fields_id']),
                                                ('company_id', '=', vals['company_id']),
                                                ('res_id', '=', vals['res_id'])])
          if property:
              property.write(vals)
          else:
              env["ir.property"].create(vals) 

This prevents recreating existing properties and only applies changes when necessary.

I'm not sure of the best way to submit this modification, so I wanted to ask if I should create another pull request with these changes or if you'd prefer to integrate them directly into this one.

Thanks again for your work and help!

acpMicrocom avatar Sep 25 '24 20:09 acpMicrocom

@acpMicrocom Thanks, i will apply your fix soon, i don't have time to test though because we stop migration campaign for now

daiduongnguyen-odoo avatar Sep 26 '24 01:09 daiduongnguyen-odoo

@duong77476-viindoo I don't manage to push commits onto your branch, so I'll start superseding your PRs with new ones

hbrunn avatar Oct 21 '24 12:10 hbrunn