[IMP] hr: improves field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'. Indeed, it gives more options to users in the way they format their content without weighting too much on the UI (tools appear on demand and not by default). Models -> Fields 1) fleet.vehicle -> description 2) fleet.vehicle.log.contract -> notes 3) hr.job -> description 4) hr.contract -> note 5) hr.leave.allocation -> notes 6) hr.applicant -> description 7) lunch.product -> description 8) lunch.order -> product_description 9) lunch.product.report -> description Task Id: 2499504 X-original-commit: afe52b050a7667f3f20696cd48cd922f635a941c
This commit is contained in:
committed by
Thibault Delavallée
parent
a7437aac10
commit
5ce7ad709c
@@ -18,7 +18,7 @@ class FleetVehicle(models.Model):
|
||||
return state if state and state.id else False
|
||||
|
||||
name = fields.Char(compute="_compute_vehicle_name", store=True)
|
||||
description = fields.Text("Vehicle Description")
|
||||
description = fields.Html("Vehicle Description")
|
||||
active = fields.Boolean('Active', default=True, tracking=True)
|
||||
company_id = fields.Many2one('res.company', 'Company', default=lambda self: self.env.company)
|
||||
currency_id = fields.Many2one('res.currency', related='company_id.currency_id')
|
||||
|
||||
@@ -46,7 +46,7 @@ class FleetVehicleLogContract(models.Model):
|
||||
help='Choose whether the contract is still valid or not',
|
||||
tracking=True,
|
||||
copy=False)
|
||||
notes = fields.Text('Terms and Conditions', help='Write here all supplementary information relative to this contract', copy=False)
|
||||
notes = fields.Html('Terms and Conditions', help='Write here all supplementary information relative to this contract', copy=False)
|
||||
cost_generated = fields.Monetary('Recurring Cost')
|
||||
cost_frequency = fields.Selection([
|
||||
('no', 'No'),
|
||||
|
||||
@@ -20,7 +20,7 @@ class Job(models.Model):
|
||||
no_of_hired_employee = fields.Integer(string='Hired Employees', copy=False,
|
||||
help='Number of hired employees for this job position during recruitment phase.')
|
||||
employee_ids = fields.One2many('hr.employee', 'job_id', string='Employees', groups='base.group_user')
|
||||
description = fields.Text(string='Job Description')
|
||||
description = fields.Html(string='Job Description')
|
||||
requirements = fields.Text('Requirements')
|
||||
department_id = fields.Many2one('hr.department', string='Department', domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||
company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.company)
|
||||
|
||||
@@ -33,7 +33,7 @@ class Contract(models.Model):
|
||||
default=lambda self: self.env.company.resource_calendar_id.id, copy=False, index=True,
|
||||
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||
wage = fields.Monetary('Wage', required=True, tracking=True, help="Employee's monthly gross wage.")
|
||||
notes = fields.Text('Notes')
|
||||
notes = fields.Html('Notes')
|
||||
state = fields.Selection([
|
||||
('draft', 'New'),
|
||||
('open', 'Running'),
|
||||
|
||||
@@ -66,7 +66,7 @@ class HolidaysAllocation(models.Model):
|
||||
'hr.employee', compute='_compute_from_holiday_type', store=True, string='Employee', index=True, readonly=False, ondelete="restrict", tracking=True,
|
||||
states={'cancel': [('readonly', True)], 'refuse': [('readonly', True)], 'validate1': [('readonly', True)], 'validate': [('readonly', True)]})
|
||||
manager_id = fields.Many2one('hr.employee', compute='_compute_from_employee_id', store=True, string='Manager')
|
||||
notes = fields.Text('Reasons', readonly=True, states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]})
|
||||
notes = fields.Html('Reasons', readonly=True, states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]})
|
||||
# duration
|
||||
number_of_days = fields.Float(
|
||||
'Number of Days', compute='_compute_from_holiday_status_id', store=True, readonly=False, tracking=True, default=1,
|
||||
|
||||
@@ -99,7 +99,7 @@ class Applicant(models.Model):
|
||||
|
||||
name = fields.Char("Subject / Application Name", required=True, help="Email subject for applications sent via email")
|
||||
active = fields.Boolean("Active", default=True, help="If the active field is set to false, it will allow you to hide the case without removing it.")
|
||||
description = fields.Text("Description")
|
||||
description = fields.Html("Description")
|
||||
email_from = fields.Char("Email", size=128, help="Applicant email", compute='_compute_partner_phone_email',
|
||||
inverse='_inverse_partner_email', store=True)
|
||||
probability = fields.Float("Probability")
|
||||
|
||||
@@ -41,7 +41,7 @@ class LunchOrder(models.Model):
|
||||
|
||||
display_toppings = fields.Text('Extras', compute='_compute_display_toppings', store=True)
|
||||
|
||||
product_description = fields.Text('Description', related='product_id.description')
|
||||
product_description = fields.Html('Description', related='product_id.description')
|
||||
topping_label_1 = fields.Char(related='product_id.category_id.topping_label_1')
|
||||
topping_label_2 = fields.Char(related='product_id.category_id.topping_label_2')
|
||||
topping_label_3 = fields.Char(related='product_id.category_id.topping_label_3')
|
||||
|
||||
@@ -111,7 +111,7 @@ class LunchProduct(models.Model):
|
||||
|
||||
name = fields.Char('Product Name', required=True, translate=True)
|
||||
category_id = fields.Many2one('lunch.product.category', 'Product Category', check_company=True, required=True)
|
||||
description = fields.Text('Description', translate=True)
|
||||
description = fields.Html('Description', translate=True)
|
||||
price = fields.Float('Price', digits='Account', required=True)
|
||||
supplier_id = fields.Many2one('lunch.supplier', 'Vendor', check_company=True, required=True)
|
||||
active = fields.Boolean(default=True)
|
||||
|
||||
@@ -15,7 +15,7 @@ class LunchProductReport(models.Model):
|
||||
product_id = fields.Many2one('lunch.product', 'Product')
|
||||
name = fields.Char('Product Name', related='product_id.name')
|
||||
category_id = fields.Many2one('lunch.product.category', 'Product Category')
|
||||
description = fields.Text('Description', related='product_id.description')
|
||||
description = fields.Html('Description', related='product_id.description')
|
||||
price = fields.Float('Price')
|
||||
supplier_id = fields.Many2one('lunch.supplier', 'Vendor')
|
||||
company_id = fields.Many2one('res.company')
|
||||
|
||||
@@ -84,9 +84,10 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="new_until"/>
|
||||
<field name='description'/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<label for="description"/>
|
||||
<field name='description'/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
@@ -148,7 +149,7 @@
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom">
|
||||
<ul>
|
||||
<li t-esc="record.description.value" class="text-muted"/>
|
||||
<li t-raw="record.description.raw_value" class="text-muted"/>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -192,7 +193,7 @@
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom">
|
||||
<ul>
|
||||
<li t-esc="record.description.value" class="text-muted"/>
|
||||
<li t-raw="record.description.raw_value" class="text-muted"/>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -52,10 +52,10 @@
|
||||
<h5 t-if="job.no_of_recruitment > 1">
|
||||
<t t-esc="job.no_of_recruitment"/> open positions
|
||||
</h5>
|
||||
<p t-if="editable"
|
||||
<div t-if="editable"
|
||||
t-field="job.description"
|
||||
class="mt16 mb0 css_non_editable_mode_hidden"/>
|
||||
<p t-esc="len((job.description or '').split(' ')) > 35 and '%s ...' % ' '.join(job.description.split(' ')[:35]) or job.description"
|
||||
<div t-esc="len((job.description or '').split(' ')) > 35 and '%s ...' % ' '.join(job.description.split(' ')[:35]) or job.description"
|
||||
class="mt16 mb0 css_editable_mode_hidden"
|
||||
/>
|
||||
<div class="o_job_infos mt16">
|
||||
|
||||
Reference in New Issue
Block a user