[IMP] *: use the new setting tag on the form view.

*: hr_timesheet, point_of_sale, pos_epson_printer, project,
    sale_project, sale_timesheet

closes odoo/odoo#110432

Related: odoo/enterprise#36050
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
Jorge Pinna Puissant
2023-01-25 08:18:01 +01:00
parent 4cdd74fc58
commit a9d3cc036f
6 changed files with 54 additions and 153 deletions
+6 -22
View File
@@ -63,17 +63,9 @@
<field name="priority">24</field> <field name="priority">24</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[hasclass('o_settings_container')]" position="inside"> <xpath expr="//div[hasclass('o_settings_container')]" position="inside">
<div class="col-lg-6 o_setting_box"> <setting string="Timesheets" help="Log time on tasks">
<div class="o_setting_left_pane"> <field name="allow_timesheets"/>
<field name="allow_timesheets"/> </setting>
</div>
<div class="o_setting_right_pane">
<label for="allow_timesheets" string="Timesheets"/>
<div class="text-muted">
Log time on tasks
</div>
</div>
</div>
</xpath> </xpath>
</field> </field>
</record> </record>
@@ -91,17 +83,9 @@
<attribute name="invisible">0</attribute> <attribute name="invisible">0</attribute>
</xpath> </xpath>
<xpath expr="//group[@name='group_time_managment']" position="inside"> <xpath expr="//group[@name='group_time_managment']" position="inside">
<div class="o_setting_box" id="timesheet_settings" colspan="2"> <setting id="timesheet_settings" string="Timesheets" help="Log time on tasks">
<div class="o_setting_left_pane"> <field name="allow_timesheets"/>
<field name="allow_timesheets"/> </setting>
</div>
<div class="o_setting_right_pane">
<label for="allow_timesheets" string="Timesheets"/>
<div class="text-muted">
Log time on tasks
</div>
</div>
</div>
</xpath> </xpath>
</field> </field>
</record> </record>
+16 -43
View File
@@ -32,55 +32,29 @@
<!-- SHOW this div in create_mode (when '+ New Shop' is clicked in the general settings.) --> <!-- SHOW this div in create_mode (when '+ New Shop' is clicked in the general settings.) -->
<div class="row mt16 o_settings_container" invisible="not context.get('pos_config_create_mode', False)"> <div class="row mt16 o_settings_container" invisible="not context.get('pos_config_create_mode', False)">
<div class="col-12 col-lg-6 o_setting_box"> <setting>
<div class="o_setting_left_pane">
<field name="module_pos_restaurant" /> <field name="module_pos_restaurant" />
</div> </setting>
<div class="o_setting_right_pane">
<label for="module_pos_restaurant"/>
</div>
</div>
</div> </div>
<!-- HIDE this div in create_mode (when '+ New Shop' is clicked in the general settings.) --> <!-- HIDE this div in create_mode (when '+ New Shop' is clicked in the general settings.) -->
<div class="row mt16 o_settings_container" invisible="context.get('pos_config_create_mode', False)"> <div class="row mt16 o_settings_container" invisible="context.get('pos_config_create_mode', False)">
<div class="col-12 col-lg-6 o_setting_box" <setting
title="Employees can scan their badge or enter a PIN to log in to a PoS session. These credentials are configurable in the *HR Settings* tab of the employee form."> title="Employees can scan their badge or enter a PIN to log in to a PoS session. These credentials are configurable in the *HR Settings* tab of the employee form."
<div class="o_setting_left_pane"> string="Multi Employees per Session"
<field name="module_pos_hr" attrs="{'readonly': [('has_active_session','=', True)]}" /> help="Allow to log and switch between selected Employees">
</div> <field name="module_pos_hr" attrs="{'readonly': [('has_active_session','=', True)]}" />
<div class="o_setting_right_pane"> <div class="content-group mt16" attrs="{'invisible': [('module_pos_hr','=',False)]}">
<span class="o_form_label">Multi Employees per Session</span> <div class="text-warning" id="warning_text_employees">
<div class="text-muted"> Save this page and come back here to set up the feature.
Allow to log and switch between selected Employees
</div>
<div class="content-group mt16" attrs="{'invisible': [('module_pos_hr','=',False)]}">
<div class="text-warning" id="warning_text_employees">
Save this page and come back here to set up the feature.
</div>
</div> </div>
</div> </div>
</div> </setting>
<div class="col-12 col-lg-6 o_setting_box" id="other_devices"> <setting id="other_devices" string="ePos Printer" help="Connect device to your PoS without an IoT Box">
<div class="o_setting_left_pane"> <field name="other_devices" />
<field name="other_devices" /> </setting>
</div> <setting string="IoT Box" help="Connect devices using an IoT Box">
<div class="o_setting_right_pane">
<label for="other_devices" string="ePos Printer"/>
<div class="text-muted mb16">
Connect device to your PoS without an IoT Box
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="is_posbox" /> <field name="is_posbox" />
</div>
<div class="o_setting_right_pane">
<label for="is_posbox" string="IoT Box"/>
<div class="text-muted mb16">
Connect devices using an IoT Box
</div>
<div class="content-group pos_iot_config" attrs="{'invisible' : [('is_posbox', '=', False)]}"> <div class="content-group pos_iot_config" attrs="{'invisible' : [('is_posbox', '=', False)]}">
<div class="row"> <div class="row">
<label string="IoT Box IP Address" for="proxy_ip" class="col-lg-4 o_light_label"/> <label string="IoT Box IP Address" for="proxy_ip" class="col-lg-4 o_light_label"/>
@@ -107,8 +81,7 @@
<field name="iface_customer_facing_display_via_proxy"/> <field name="iface_customer_facing_display_via_proxy"/>
</div> </div>
</div> </div>
</div> </setting>
</div>
<div groups="base.group_system"> <div groups="base.group_system">
<p> <p>
More settings: <a href="#" name="%(action_pos_configuration)d" type="action" class="btn-link o_form_uri" role="button">Configurations > Settings</a> More settings: <a href="#" name="%(action_pos_configuration)d" type="action" class="btn-link o_form_uri" role="button">Configurations > Settings</a>
@@ -5,7 +5,7 @@
<field name="model">pos.config</field> <field name="model">pos.config</field>
<field name="inherit_id" ref="point_of_sale.pos_config_view_form"/> <field name="inherit_id" ref="point_of_sale.pos_config_view_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[@id='other_devices']//div[hasclass('o_setting_right_pane')]" position="inside"> <xpath expr="//setting[@id='other_devices']" position="inside">
<div class="content-group" attrs="{'invisible' : [('other_devices', '=', False)]}"> <div class="content-group" attrs="{'invisible' : [('other_devices', '=', False)]}">
<field name="epson_printer_ip" placeholder="Epson Receipt Printer IP Address" /> <field name="epson_printer_ip" placeholder="Epson Receipt Printer IP Address" />
<div class="row" attrs="{'invisible': [('epson_printer_ip', 'in', [False, ''])]}"> <div class="row" attrs="{'invisible': [('epson_printer_ip', 'in', [False, ''])]}">
+23 -63
View File
@@ -556,79 +556,39 @@
<group> <group>
<group name="group_tasks_managment" string="Tasks Management" col="1" class="row mt16 o_settings_container" groups="project.group_subtask_project,project.group_project_task_dependencies,project.group_project_milestone,project.group_project_recurring_tasks"> <group name="group_tasks_managment" string="Tasks Management" col="1" class="row mt16 o_settings_container" groups="project.group_subtask_project,project.group_project_task_dependencies,project.group_project_milestone,project.group_project_recurring_tasks">
<div> <div>
<div class="o_setting_box" id="subtask_settings" groups="project.group_subtask_project"> <setting id="subtask_settings" help="Split your tasks to organize your work into sub-milestones" groups="project.group_subtask_project">
<div class="o_setting_left_pane"> <field name="allow_subtasks"/>
<field name="allow_subtasks"/> </setting>
</div> <setting id="recurring_tasks_setting" help="Auto-generate tasks for regular activities" groups="project.group_project_recurring_tasks">
<div class="o_setting_right_pane"> <field name="allow_recurring_tasks"/>
<label for="allow_subtasks"/> </setting>
<div class="text-muted"> <setting id="task_dependencies_setting" help="Determine the order in which to perform tasks" groups="project.group_project_task_dependencies">
Split your tasks to organize your work into sub-milestones <field name="allow_task_dependencies"/>
</div> </setting>
</div> <setting id="project_milestone_setting" help="Track major progress points that must be reached to achieve success" groups="project.group_project_milestone">
</div> <field name="allow_milestones"/>
<div class="o_setting_box mt-4" id="recurring_tasks_setting" groups="project.group_project_recurring_tasks"> </setting>
<div class="o_setting_left_pane">
<field name="allow_recurring_tasks"/>
</div>
<div class="o_setting_right_pane">
<label for="allow_recurring_tasks"/>
<div class="text-muted">
Auto-generate tasks for regular activities
</div>
</div>
</div>
<div class="o_setting_box mt-4" id="task_dependencies_setting" groups="project.group_project_task_dependencies">
<div class="o_setting_left_pane">
<field name="allow_task_dependencies"/>
</div>
<div class="o_setting_right_pane">
<label for="allow_task_dependencies"/>
<div class="text-muted">
Determine the order in which to perform tasks
</div>
</div>
</div>
<div class="o_setting_box mt-4" id="project_milestone_setting" groups="project.group_project_milestone">
<div class="o_setting_left_pane">
<field name="allow_milestones"/>
</div>
<div class="o_setting_right_pane">
<label for="allow_milestones"/>
<div class="text-muted">
Track major progress points that must be reached to achieve success
</div>
</div>
</div>
</div> </div>
</group> </group>
<group name="group_time_managment" string="Time Management" invisible="1" col="1" class="row mt16 o_settings_container"/> <group name="group_time_managment" string="Time Management" invisible="1" col="1" class="row mt16 o_settings_container"/>
<group name="group_documents_analytics" string="Analytics" col="1" class="row mt16 o_settings_container" attrs="{'invisible': [('allow_rating', '=', False)]}"> <group name="group_documents_analytics" string="Analytics" col="1" class="row mt16 o_settings_container" attrs="{'invisible': [('allow_rating', '=', False)]}">
<div> <div>
<field name="allow_rating" invisible="1"/> <field name="allow_rating" invisible="1"/>
<div class="o_setting_box" name="analytic_div" groups="project.group_project_rating"> <setting name="analytic_div" help="Get customer feedback" groups="project.group_project_rating">
<div class="o_setting_left_pane"> <field name="rating_active"/>
<field name="rating_active"/> <div class="mt16" attrs="{'invisible':[('rating_active','==',False)]}">
</div> <field name="rating_status" widget="radio" />
<div class="o_setting_right_pane"> <div attrs="{'required': [('rating_status','=','periodic')], 'invisible': [('rating_status','!=','periodic')]}">
<label for="rating_active" /> <label for="rating_status_period"/>
<div class="text-muted"> <field name="rating_status_period"/>
Get customer feedback
</div> </div>
<div class="mt16" attrs="{'invisible':[('rating_active','==',False)]}"> <div class="content-group">
<field name="rating_status" widget="radio" /> <div class="mt8">
<div attrs="{'required': [('rating_status','=','periodic')], 'invisible': [('rating_status','!=','periodic')]}"> <button name="%(project.open_task_type_form_domain)d" context="{'project_id':id}" icon="fa-arrow-right" type="action" string="Set a Rating Email Template on Stages" class="btn-link"/>
<label for="rating_status_period"/>
<field name="rating_status_period"/>
</div>
<div class="content-group">
<div class="mt8">
<button name="%(project.open_task_type_form_domain)d" context="{'project_id':id}" icon="fa-arrow-right" type="action" string="Set a Rating Email Template on Stages" class="btn-link"/>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </setting>
</div> </div>
</group> </group>
</group> </group>
@@ -56,17 +56,9 @@
<xpath expr="//group[@name='group_time_managment']" position="after"> <xpath expr="//group[@name='group_time_managment']" position="after">
<group name="group_sales_invoicing" string="Sales &amp; Invoicing" col="1" class="row mt16 o_settings_container col-lg-6"> <group name="group_sales_invoicing" string="Sales &amp; Invoicing" col="1" class="row mt16 o_settings_container col-lg-6">
<div> <div>
<div class="o_setting_box" id="allow_billable_container"> <setting help="Invoice your time and material to customers" id="allow_billable_container">
<div class="o_setting_left_pane"> <field name="allow_billable"/>
<field name="allow_billable"/> </setting>
</div>
<div class="o_setting_right_pane">
<label for="allow_billable"/>
<div class="text-muted" id="allow_billable_setting">
Invoice your time and material to customers
</div>
</div>
</div>
</div> </div>
</group> </group>
</xpath> </xpath>
@@ -35,19 +35,11 @@
<field name="model">project.project</field> <field name="model">project.project</field>
<field name="inherit_id" ref="hr_timesheet.project_project_view_form_simplified_inherit_timesheet"/> <field name="inherit_id" ref="hr_timesheet.project_project_view_form_simplified_inherit_timesheet"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//div[hasclass('o_setting_box')]" position="before"> <xpath expr="//setting" position="before">
<div class="col-lg-6 o_setting_box"> <field name="company_id" invisible="1"/>
<div class="o_setting_left_pane"> <setting help="Invoice your time and material to customers">
<field name="company_id" invisible="1"/> <field name="allow_billable"/>
<field name="allow_billable"/> </setting>
</div>
<div class="o_setting_right_pane">
<label for="allow_billable"/>
<div class="text-muted" id="allow_billable_setting">
Invoice your time and material to customers
</div>
</div>
</div>
</xpath> </xpath>
</field> </field>
</record> </record>