0

New Odoo user here.

It's been a few days since I started messing around with Odoo(v12). I managed to build a module, including creating models, views and menus. It's working like a charm, though there is one issue that is really bothering me.

I've read that running odoo-bin with the --dev=all arg -- which requires watchdog, by the way -- is supposed to trigger a server restart whenever .py or .xml files are changed inside one of the addons folders.

The server does restart when I modify PYTHON files, but so far, even after trying it out for hours, I can't seem to make the same thing work for XML files.

For reference, I'm building the openacademy module from the official documentation, and I'd like for the server to read the views from the XML files instead of the database and reload on change, so I can customize the forms and views and see the result without having to upgrade my module every single time.

--dev=all, unfortunately, doesn't seem to work.

Can anyone help?

Edit: here's the full command I'm using to start up Odoo:

py odoo-bin -c odoo.conf --dev=all

P.S: I'm running Odoo 12 source on Windows 10 64bit

Kyle Sentient
  • 487
  • 3
  • 7
  • 20
  • 1
    have you tried? -u – MohitGhodasara Jan 15 '19 at 07:21
  • @MohitGhodasara I have. It doesn't work either. – Kyle Sentient Jan 15 '19 at 07:30
  • 1
    sometimes those things happened because of cache try to do with disabled cache – MohitGhodasara Jan 15 '19 at 07:32
  • Working perfectly for me, I even checked again before answering. – arryph Jan 15 '19 at 07:34
  • Cleared the cache, didn't work. Tried another browser, didn't work. Tried it in Chrome's Incognito mode, didn't work either. I have no idea what's going on... – Kyle Sentient Jan 15 '19 at 08:32
  • 1
    @kyle-sentient can you show as a command that you using? also, directory permissions and what particular file are you modifying in odoo 12 – MohitGhodasara Jan 15 '19 at 09:00
  • @MohitGhodasara Here's the command: py odoo-bin -c odoo.conf --dev=all. I tried with the -u openacademy flag as well, but same result. As to directory permissions, I'm not sure what that's about. I'm modifying the openacademy.xml file in the views directory of my custom module (Yes, I added it in the manifest). – Kyle Sentient Jan 15 '19 at 09:56
  • 1
    @kyle-sentient looks perfect but one more thing I want to mention is the security file (CSV) if your view or menu is not showing that is because of it.. keep trying and let us know the solution. – MohitGhodasara Jan 15 '19 at 10:04
  • @MohitGhodasara Well, I tried everything you guys suggested, but nothing worked. The only way I found out of this issue was installing Ubuntu and trying the command after installing Python, PostgreSQL and Odoo. It works as expected there. Though why it doesn't work on Windows is up to anyone's guess. – Kyle Sentient Jan 15 '19 at 22:04

2 Answers2

1

--dev=all actually works in conjunction with watchdog, so if you have watchdog package installed in your running odoo python environment, any change in your addons .py file with cause watchdog to notify running server and the server will reload automatically. You can actually see those messages if you have loglevel set to info. In case view update, changes in xml file doesn't actually reload the server but causing a refresh in the browser automatically updates the view. But, if there is any error in the view definitions, i faced this situation that odoo is not updating the changes. So make sure that there is no error in the xml views and update should be done automatically after page refresh.

arryph
  • 2,725
  • 10
  • 15
  • Thank you, but I'm afraid this is not working for me. I've run the server with the --dev=all flag and refreshed the page after making a few changes to an xml view and making sure that it was correct, but none of my changes show up. – Kyle Sentient Jan 15 '19 at 08:31
  • 1
    can you check making change in any of the `.py` files and checking in the logs if server reload occurred? Just to make sure your server is running in dev environment. – arryph Jan 15 '19 at 08:40
  • Yep, the server does reload when Python files are modified. It's only the xml that's not working – Kyle Sentient Jan 15 '19 at 09:53
  • 1
    `--dev all` enables all the development feature including `xml`, but as it is not working for you, try `--dev xml` instead. – arryph Jan 15 '19 at 10:08
  • Thank you for the help. Unfortunately, no variant of the flag seems to work on Windows. It works just fine on Ubuntu, though. I guess I'll just have to stick with Linux for the rest of my work. – Kyle Sentient Jan 15 '19 at 22:06
  • 1
    Yeah that might be the cause, I have been working on Linux/Mac platform, never on Windows so never had such problem. – arryph Jan 16 '19 at 04:39
  • Did you fix this? And how? I have same issues – user257980 Jan 17 '21 at 18:39
0

Late to the party but as I spent a lot of time trying to figure this out on both Mac and Ubuntu it's worth noting that the --dev xml does not update to reflect every change in a .xml file. I was modifying menus and seeing nothing and thinking it was broken but from some investigation I discovered that the changes only pick up modifications to ir.ui.view models and (I think from looking at the source code) ir.rule models.