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
import base64 | |
from odoo import models, fields, api | |
class SomeModel(models.Model): | |
_name = 'some.model' | |
field1 = fields.Char(string="Field 1") | |
field2 = fields.Boolean(string="Field 2") | |
@api.multi |
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
import base64 | |
from odoo import models, fields, api | |
class SomeModel(models.Model): | |
_name = 'some.model' | |
field1 = fields.Char(string="Field 1") | |
field2 = fields.Boolean(string="Field 2") | |
@api.multi |
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
<odoo> | |
<record model="ir.ui.view" id="attendance_recap_report_wizard"> | |
<field name="name">HR Attendance Custom Recap Report</field> | |
<field name="model">attendance.recap.report.wizard</field> | |
<field name="type">form</field> | |
<field name="arch" type="xml"> | |
<form string="Attendance Recap Report"> | |
<group> | |
<group> | |
<field name="date_start"/> |
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
from datetime import datetime, timedelta | |
from odoo import models, fields, api | |
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT as DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT as DATETIME_FORMAT | |
class AttendanceRecapReportWizard(models.TransientModel): | |
_name = 'attendance.recap.report.wizard' | |
date_start = fields.Date(string="Start Date", required=True, default=fields.Date.today) |
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
<odoo> | |
<record model="report.paperformat" id="paperformat_attendance_recap_report"> | |
<field name="name">paperformat.attendance.recap.report</field> | |
<field name="default" eval="True"/> | |
<field name="format">A4</field> | |
<field name="page_width">0</field> | |
<field name="page_width">0</field> | |
<field name="orientation">Portrait</field> | |
<field name="margin_top">30</field> | |
<field name="margin_right">5</field> |
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
# -*- coding: utf-8 -*- | |
"""Author: | |
@CakJuice <hd.brandoz@gmail.com> | |
Website: | |
https://cakjuice.com | |
""" | |
from __future__ import division |
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
# -*- coding: utf-8 -*- | |
"""Author: | |
@CakJuice <hd.brandoz@gmail.com> | |
Website: | |
https://cakjuice.com | |
""" | |
import logging |
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
/** | |
* A menu that lets a user delete a selected vertex of a path. | |
* @constructor | |
*/ | |
function DeleteVertexMenu() { | |
if (typeof google === 'undefined' || !google) return; | |
this.div_ = document.createElement('div'); | |
this.div_.className = 'delete-menu'; |
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
from odoo import models, fields | |
class ParentModel(models.Model): | |
_name = 'parent.model' | |
parent_field_1 = fields.Char(string="Parent Field 1") | |
parent_field_2 = fields.Integer(string="Parent Field 2") | |
# If you want to display child data, you must create One2many field. |
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
const html = document.getElementsByTagName('html')[0]; | |
html.addEventListener('click', function(e) { | |
/* Event listener handler for html element. | |
* This code will be executed when user clicked on all html area. | |
*/ | |
if (e.target.className === 'nav-link dropdown-toggle') { | |
// Check whether element is 'nav-link dropdown toggle'. | |
// Set nextElementSibling to toggling 'show' class name. |
OlderNewer