[IMP] mrp: Improve the settings form view
This commit is contained in:
committed by
Yannick Tivisse
parent
a3d23c93b8
commit
931afc2ff1
@@ -8,6 +8,13 @@ class HrExpenseConfigSettings(models.TransientModel):
|
||||
|
||||
alias_prefix = fields.Char('Default Alias Name for Expenses')
|
||||
alias_domain = fields.Char('Alias Domain', default=lambda self: self.env["ir.config_parameter"].sudo().get_param("mail.catchall.domain"))
|
||||
group_analytic_accounting = fields.Boolean(string='Analytic Accounting',
|
||||
implied_group='analytic.group_analytic_accounting')
|
||||
group_uom = fields.Boolean("Units of Measure",
|
||||
implied_group='product.group_uom')
|
||||
default_alias_email = fields.Boolean(string='Let your employees record expenses by email', default_model='hr.expense.config.settings')
|
||||
module_project = fields.Boolean(string="Project")
|
||||
module_sale = fields.Boolean(string="Customer Billing")
|
||||
|
||||
@api.model
|
||||
def get_default_alias_prefix(self, fields):
|
||||
|
||||
@@ -1,39 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_hr_expense_configuration" model="ir.ui.view">
|
||||
<field name="name">Configure Expense</field>
|
||||
<record id="hr_expense_config_setting_view_form" model="ir.ui.view">
|
||||
<field name="name">hr.expense.config.settings.form</field>
|
||||
<field name="model">hr.expense.config.settings</field>
|
||||
<field name="inherit_id" eval="False"/>
|
||||
<field name="arch" type="xml">
|
||||
<form class="oe_form_configuration">
|
||||
<header>
|
||||
<button string="Apply" type="object" name="execute" class="oe_highlight"/>
|
||||
<button string="Save" type="object" name="execute" class="oe_highlight"/>
|
||||
<button string="Cancel" type="object" name="cancel" class="oe_link"/>
|
||||
</header>
|
||||
<group string="Expenses" name="config_alias">
|
||||
<label for="id" string="Expense Email Alias"/>
|
||||
<div>
|
||||
<div attrs="{'invisible': [('alias_domain', 'in', ['localhost', '', False])]}">
|
||||
<p class="text-muted">
|
||||
You can setup a generic email alias to create
|
||||
incoming expenses easily. Write an email with the receipt
|
||||
in attachment to create an expense line in one click. If the mail
|
||||
subject contains the product's internal reference between brackets,
|
||||
the product will be set automatically. Type the expense amount
|
||||
in the mail subject to set it on the expense too.
|
||||
</p>
|
||||
<field name="alias_prefix" class="oe_inline"/>
|
||||
<span>@</span>
|
||||
<field name="alias_domain" class="oe_inline" readonly="1"/>
|
||||
<sheet>
|
||||
<h2>Recording</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="You can setup a generic email alias to create incoming expenses easily. Write an email with the receipt in attachment to create an expense line in one click. If the mail subject contains the product's internal reference between brackets, the product will be set automatically. Type the expense amount in the mail subject to set it on the expense too.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="default_alias_email"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label string="Emails" for="default_alias_email"/>
|
||||
<div class="text-muted">
|
||||
Let your employees record expenses by email
|
||||
</div>
|
||||
<div class="content-group" attrs="{'invisible': ['|', ('default_alias_email', '=', False), ('alias_domain', 'in', ['localhost', '', False])]}">
|
||||
<div class="mt16">
|
||||
<label string="Email Alias" class="o_light_label"/>
|
||||
<field name="alias_prefix" class="oe_inline"/>
|
||||
<span>@</span>
|
||||
<field name="alias_domain" class="oe_inline" readonly="1"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-group" attrs="{'invisible': ['|', ('default_alias_email', '=', False), ('alias_domain', 'not in', ['localhost', '', False])]}">
|
||||
<div class="mt16">
|
||||
<button type="action" name="base_setup.action_general_configuration" icon="fa-arrow-right" string="Setup your domain alias" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div attrs="{'invisible': [('alias_domain', 'not in', ['localhost', '', False])]}">
|
||||
<button type="action"
|
||||
name="base_setup.action_general_configuration"
|
||||
string="Setup your domain alias" class="oe_link"/>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_uom"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_uom"/>
|
||||
<div class="text-muted">
|
||||
Set units of measure on expense types (unit, distance, etc.)
|
||||
</div>
|
||||
<div class="content-group" attrs="{'invisible': [('group_uom','=',False)]}">
|
||||
<div class="mt16">
|
||||
<button name="%(product.product_uom_form_action)d" icon="fa-arrow-right" type="action" string="Units of Measure" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<h2>Billing</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" title="This installs the Sales Management app.
|
||||
Expenses can be invoiced to customers from sales orders.">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_sale"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_sale"/>
|
||||
<div class="text-muted">
|
||||
Sell services and invoice expenses to customer
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2>Recommended Apps</h2>
|
||||
<div class="row mt16 o_settings_container">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="module_project"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="module_project"/>
|
||||
<div class="text-muted">
|
||||
Schedule the tasks of your employees
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 o_setting_box">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="group_analytic_accounting"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="group_analytic_accounting"/>
|
||||
<div class="text-muted">
|
||||
Track costs & revenues by project, department, etc.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user