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
for record in self: | |
if record.delivery_count > 0: | |
record['x_delivery_status'] = 'draft' | |
else: | |
global_done = False | |
for picking in record.picking_ids.sorted(key=lambda r: r.id): | |
local_done = False | |
if picking.state in ['waiting','confirmed']: | |
record['x_delivery_status'] = 'waiting' | |
if picking.state in ['assigned']: |
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
# https://www.odoo.com/forum/help-1/how-can-i-leverage-employee-skills-when-assigning-tasks-in-the-projects-app-181599 | |
###### Offboard: | |
env['ir.ui.view'].search([('name','=','custom_ray_odoo')]).unlink() | |
env['ir.model.fields'].search([('name','=','x_employee_skill_ids')]).unlink() | |
###### Onboard: | |
# Schema |
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
# Available variables: | |
# - env: Odoo Environment on which the action is triggered | |
# - model: Odoo Model of the record on which the action is triggered; is a void recordset | |
# - record: record on which the action is triggered; may be void | |
# - records: recordset of all records on which the action is triggered in multi-mode; may be void | |
# - time, datetime, dateutil, timezone: useful Python libraries | |
# - log: log(message, level='info'): logging function to record debug information in ir.logging table | |
# - UserError: Warning Exception to use with raise | |
# To return an action, assign: action = {...} |
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
https://www.odoo.com/documentation/14.0/reference/orm.html#fields | |
# simple Char field | |
name = fields.Char(string="Name", required="True", readonly="False", invisible="False", help="The name field help string", ) | |
# note that required, readonly and invisible might be better defined in the View where they can be controlled via attrs | |
# to set a default | |
default='' # the name of the value |
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
for record in records: | |
if record.model == 'project.task': | |
task = env['project.task'].search([('id','=',record.res_id)]) | |
new_body = "<dl><dt>Project: </dt><dd>%s</dd>" % task.project_id.display_name | |
new_body += "<dt>Customer: </dt><dd>%s</dd>" % task.partner_id.display_name | |
new_body += "<dt>Deadline: </dt><dd>%s</dd>" % (task.date_deadline and task.date_deadline or 'N/A') | |
record['body_html'] = record.body_html + new_body + "</dl>" |
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"?> | |
<tree string="Forecasted Inventory" create="0" multi_edit="1" editable="top"> | |
<field name="write_date"/> | |
<field name="write_uid"/> | |
<field name="origin" readonly="1"/> | |
<field name="picking_id" widget="one2many_button" readonly="1"/> | |
<field name="date"/> | |
<field name="x_step"/> | |
<field name="product_id" readonly="1"/> | |
<field name="product_packaging_id" optional="hide" groups="product.group_stock_packaging"/> |
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
Images |
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
# Example Vendor Bill | |
Track "Track", 100 units x $10 = $1,000 | |
Train "Train", 250 units x $7 = $1,750 | |
Design "for Track", 1 unit x $195 | |
Freight "for the PO", 1 unit x $595 | |
Overcharge "for Track", 100 units x price_unit | |
Overcharge, "for Train", 250 units x price_unit | |
# We want to know, for each LC, should it be applied to one product, or both | |
# After this we need to delete the lines where there isn't a match - no design on train, no track overchange on train, etc |
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
network: | |
version: 2 | |
ethernets: | |
enp0s3: | |
addresses: [192.168.1.202/24] | |