This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@api.one | |
def btn_send_email(self): | |
template_obj = self.env['email.template'].sudo().search([('name','=','Email Template Name')], limit=1) | |
if template_obj: | |
receipt_list = ['abc@gmail.com','xyz@yahoo.com'] | |
email_cc = ['test@gmail.com'] | |
body = template_obj.body_html | |
body=body.replace('--department--',self.department_id.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@api.onchange('field_1','field_2','field_3','field_4','field_5') | |
def onchange_of_fields(self): | |
res={} | |
res['domain'] = {'many2many_field': []} | |
for each in self: | |
if each.field_1: | |
res['domain']['many2many_field'].append(('field_1', '=', each.field_1.id)) | |
if each.field_2: | |
res['domain']['many2many_field'].append(('field_2', '=', each.field_2.id)) | |
if each.field_3: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class gym_body_parts_config(models.Model): | |
_name = 'gym.body.parts.config' | |
sequence = fields.Integer(default=10,help="Gives the sequence order when displaying a list of records.") | |
name = fields.Char(string="Name", required=True) | |
progress_percentpie = fields.Integer(compute='_compute_progress_percentpie') | |
@api.depends('name','sequence') | |
def _compute_progress_percentpie(self): | |
for u in self: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class gym_body_parts_config(models.Model): | |
_name = 'gym.body.parts.config' | |
sequence = fields.Integer(default=10,help="Gives the sequence order when displaying a list of records.") | |
name = fields.Char(string="Name", required=True) | |
progress_gauge = fields.Integer(compute='_compute_progress_gauge') | |
@api.depends('name','sequence') | |
def _compute_progress_gauge(self): | |
for u in self: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class gym_body_parts_config(models.Model): | |
_name = 'gym.body.parts.config' | |
sequence = fields.Integer(default=10,help="Gives the sequence order when displaying a list of records.") | |
name = fields.Char(string="Name", required=True) | |
progress_bar = fields.Integer(compute='_compute_progress_bar') | |
@api.depends('name','sequence') | |
def _compute_progress_bar(self): | |
for u in self: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<record id="inherit_view_task_kanban" model="ir.ui.view"> | |
<field name="name">inherit.project.task.kanban</field> | |
<field name="model">project.task</field> | |
<field name="inherit_id" ref="project.view_task_kanban" /> | |
<field name="arch" type="xml"> | |
<xpath expr="//kanban" position="attributes"> | |
<attribute name="group_create">0</attribute> | |
<attribute name="group_delete">0</attribute> | |
<attribute name="group_edit">0</attribute> | |
<attribute name="archivable">0</attribute> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<record id="inherited_view_project_project_filter" model="ir.ui.view"> | |
<field name="name">inherited.project.project.select</field> | |
<field name="model">project.project</field> | |
<field name="inherit_id" ref="project.view_project_project_filter"/> | |
<field name="arch" type="xml"> | |
<!--Below example shows how to visible invisible fields in search view --> | |
<xpath expr="//search/field[@name='user_id']" position="attributes"> | |
<attribute name="invisible">1</attribute> | |
</xpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Inherit task search view --> | |
<record id="inherit_task_search_view" model="ir.ui.view"> | |
<field name="name">project.task.search.form</field> | |
<field name="model">project.task</field> | |
<field name="inherit_id" ref="project.view_task_search_form"/> | |
<field name="arch" type="xml"> | |
<!--Below example shows how to visible invisible fields in search view --> | |
<xpath expr="//search/field[@name='name']" position="attributes"> | |
<attribute name="string">You can change string or label of a field</attribute> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Inherit task tree view --> | |
<record id="inherit_project_task_tree" model="ir.ui.view"> | |
<field name="name">project.task.tree.inherit</field> | |
<field name="model">project.task</field> | |
<field name="inherit_id" ref="project.view_task_tree2"/> | |
<field name="arch" type="xml"> | |
<xpath expr="//tree" position="attributes"> | |
<attribute name="delete">1</attribute> | |
</xpath> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<record id="inherit_project_task_view_form" model="ir.ui.view"> | |
<field name="name">project.task.view.inherit.form</field> | |
<field name="model">project.task</field> | |
<field name="inherit_id" ref="project_enterprise.project_task_view_form"/> | |
<field name="arch" type="xml"> | |
<xpath expr="//label[@for='planned_date_begin']" position="attributes"> | |
<attribute name="invisible">1</attribute> | |
</xpath> | |
<xpath expr="//div[hasclass('w-100')]" position="attributes"> | |
<attribute name="invisible">1</attribute> |