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
# Access employee shipments and filter by payslip date range | |
shipment_count = len(employee.shipments.filtered( | |
lambda s: s.scheduled_date and s.scheduled_date.date() >= payslip.date_start and s.scheduled_date.date() <= payslip.date_end | |
)) | |
# Return the shipment count for further calculations if needed | |
result = shipment_count | |
# Access employee shipments and filter by payslip date range | |
total_trip_cost = sum(employee.x_studio_one2many_field_5kk_1ia59qec4.filtered( |
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
[options] | |
# | |
# WARNING: | |
# If you use the Odoo Database utility to change the master password be aware | |
# that the formatting of this file WILL be LOST! A copy of this file named | |
# /etc/odoo/openerp-server.conf.template has been made in case this happens | |
# Note that the copy does not have any first boot changes | |
#----------------------------------------------------------------------------- | |
# Odoo Server Config File - TurnKey Linux |
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
<?xml version="1.0" encoding="utf-8"?> | |
<odoo> | |
<data> | |
<!-- Inherit Form View to Modify it --> | |
<record id="kod_res_partner_inherit" model="ir.ui.view"> | |
<field name="name">kod.res.partner.form.inherit</field> | |
<field name="model">res.partner</field> | |
<field name="inherit_id" ref="base.view_partner_form"/> | |
<field name="arch" type="xml"> |
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_a4"> | |
<field name="name">paperformat.custom.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
{ | |
'name':'Your module manifest name' | |
'assets': { | |
'web.assets_backend': [ | |
'your_module/static/src/js/your_css.your_css', | |
'your_module/static/src/js/your_js.js', | |
], | |
'web.assets_common': [ | |
'your_module/static/src/js/your_css.your_css', | |
'your_module/static/src/js/your_js.js', |
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
<?xml version="1.0" encoding="utf-8"?> | |
<odoo> | |
<data> | |
<template id="assets_backend" name="doc assets" inherit_id="web.assets_backend"> | |
<xpath expr="." position="inside"> | |
<link rel="stylesheet" href="/your_module/static/src/css/your_css.css"/> | |
<script type="text/javascript" src="/your_module/static/src/js/your_js.js"/> | |
</xpath> | |
</template> | |
</data> |
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> | |
<data noupdate="0"> | |
<record id="cron_id" forcecreate='True' model="ir.cron"> | |
<field name="name">Cron Name</field> | |
<field eval="True" name="active"/> | |
<field name="user_id" ref="base.user_root"/> | |
<field name="interval_number">5</field> | |
<field name="interval_type">minutes</field> | |
<field name="numbercall">-1</field> | |
<field name="model_id" ref="model_your_model_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
class your_model_class_name (models.Model): | |
_name = "your_model_name" | |
@api.model | |
def create(self, vals): | |
if vals.get('seq', 'New') == 'New': | |
vals['seq'] = self.env['ir.sequence'].next_by_code('example.seq') or '/' | |
newId = super(your_model_class_name, self).create(vals) | |
return newId |
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
def create_invoice(self): | |
move_dict = { | |
'narration': "Name", | |
'ref': name, | |
'journal_id': journal_id.id, | |
'date': date, | |
} | |
line_ids = [] |
NewerOlder