Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
10587 Widoki

When i create a template via XML like this :

<template name="Test page" id="website.test" page="True">

   <t t-call="website.layout">

    <div id="wrap">

     <div class="container">

      <h1>My template</h1>

     </div>

    </div>

   </t>

  </template>

I can see in my page ( /page/test ) the H1 title. I'm able to edit it with the builder.

After that, when i try to update the XML code of this template, i can't see the updated code in front. There is still my modified H1.

The only way i can get back to the XML version is by uninstalling my theme and reactivate it. 

Is there another way without uninstalling the theme? The problem is that there is multiple pages and templates in this theme. So if i uninstall it, i lose every modifications :/

Thank you :)

Awatar
Odrzuć

I am just guessing here, but from my point of view this behavior makes sense: If you modify the XML via the builder, Odoo will probably save the modifications in the database and will not overwrite your xml (imho the sane choice, as you don't want to start overwriting xml files of addons). I don't think you can directly edit the xml changes, you'll have to probably dig into the Odoo sources to find out where the modified version is saved (maybe it's a text file, you could try using grep or ag to search for a text you inserted in the odoo folder).

However, I think there is an alternative. You can start the odoo server with the option "-u addon_name" and odoo will automatically update the addon with the name addon_name (this would be your theme). That way, you can edit the xml file with your favorite text editor, kill the server & restart it and you'll immediately see your changes. But editing with the builder will probably be a lot faster, as the server takes a while to start (especially if your machine is older).

Autor Najlepsza odpowiedź

Thank you for you explanations!

The only problem here is that in my theme, i have multiple templates, updated in the builder.

So if i want to reload only this one, i will not be able to :/

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
sty 22
2860
1
gru 22
3868
0
mar 19
1413
2
mar 15
5797
2
gru 22
6132