[FIX] Surround setting view added fields by more standard markup#1363
[FIX] Surround setting view added fields by more standard markup#1363
Conversation
A `div` tag with the `o_setting_box` class is added around the fields and their label. This seems to be a more standard markup among the OCA. At least the remove_odoo_enterprise module expects it, see issue OCA/server-brand#116
remi-filament
left a comment
There was a problem hiding this comment.
It works, though I think you do not need to create 2 separate o_settings_container div, since these are related.
You probably could use the following instead :
<xpath expr="//div[div[div[field[@name='create_new_line_at_contract_line_renew']]]]" position="after">
<div class="row mt16 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="enable_contract_forecast"/>
</div>
<div class="o_setting_right_pane">
<label for="enable_contract_forecast"/>
<div class="row mt16" attrs="{'invisible': [('enable_contract_forecast', '=', False)]}">
<label for="contract_forecast_interval" string="Forecast Interval" class="oe_inline"/>
<div>
<field name="contract_forecast_interval" class="oe_inline"/>
<field name="contract_forecast_rule_type" class="oe_inline"/>
</div>
</div>
</div>
</div>
</div>
</xpath>(also I find it easier to read xpath using div[xxx] rather than xxx/parent::div so I proposed that change as well in code snippet above)
…gs_container div This simplifies the markup and reduce useless vertical gaps between them.
|
@remi-filament thanks for the suggestion. While we're at improving the xpath I made a different suggestion though, please review. cc @Honeyxilia for a new review also please. |
…ter the contract's The new xpath is both: - more robust as is does not depend on the intermediate tags between the targeted container and the field it contains - more explicit as it selects explicitely a o_settings_container div before adding a similar container right after the targeted one.
2560b3c to
9cb2cf1
Compare
remi-filament
left a comment
There was a problem hiding this comment.
Hi @fcayre thanks for this improvement, my comments below (none are blocking) :
- Good catch with /ancestor which is more readable than multiple parents, though IMO it is harder to understand than imbricated div (div[div[div[field[]]]]), but this is my personal pov
- I still think that you could have the second part with interval in the same than the enable_contract_forecast boolean (which also makes sense since these parameters are related and could therefore be grouped in the same o_setting_box div)
|
This PR has the |
|
Use a proper commit name please |

A
divtag with theo_setting_boxclass is added around the fields and their label.This seems to be a more standard markup among the OCA. At least the remove_odoo_enterprise module expects it, see issue OCA/server-brand#116