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
picking_ids = line.package_preparation_id.picking_ids.ids | |
search_args = [ | |
('picking_id', 'in', picking_ids), | |
('product_id', '=', line.product_id.id), | |
] | |
pack_items = self.env['stock.pack.operation'].search(search_args) | |
lots = [] | |
for item in pack_items: | |
lots.extend([x.lot_id.name for x in item.pack_lot_ids]) |
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
#!/usr/bin/env python | |
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE | |
# Written by Nathan Hamiel (2010) | |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
from optparse import OptionParser | |
class RequestHandler(BaseHTTPRequestHandler): | |
def do_GET(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
@api.model | |
def translate(self, term): | |
"""Load `term` translation.""" | |
translations = self.env['ir.translation'] | |
name = '' # can ben empty since we are passing the source = term | |
_type = 'code' | |
lang = self.env.context.get('lang') | |
return translations._get_source(name, _type, lang, source=term) |
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 -*- | |
from copy import copy | |
from datetime import timedelta | |
ONE_DAY = timedelta(days=1) | |
class datetimerange(object): | |
"""Just like ``xrange``, but working on ``datetime``.""" |
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
<!-- | |
here if you don't have a description you'll see "My description", | |
no matter if you can edit the page or not. | |
--> | |
<div t-field="main_object.description">My description</div> | |
<!-- | |
my workaround ATM: render w/ `t-field` only if editable | |
--> |
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> | |
<template id="summernote" name="My summernote assets" inherit_id="web_editor.assets_editor"> | |
<xpath expr="//script[last()]" position="after"> | |
<script type="text/javascript" src="/my_mod/static/js/summernote_overrides.js"></script> | |
</xpath> | |
</template> | |
</odoo> |
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
<adapter | |
provides="plone.outputfilters.interfaces.IFilter" | |
name="b_to_strong" | |
for="* *" | |
factory=".transforms.BoldReplacer" | |
/> | |
<adapter | |
provides="plone.outputfilters.interfaces.IFilter" | |
name="i_to_em" |
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
""" | |
Use with | |
bin/instance run export_skin_folder.py | |
This script will extract the portal_skins folder | |
named in SKINFODLER_NAME to the DEST directory | |
""" | |
import os | |
import sys | |
PLONE_PORTAL = 'Plone' |
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
(function ($) { | |
"use strict"; | |
if ((typeof window.widgets) === 'undefined') { | |
window.widgets = {}; | |
} | |
var widgets = window.widgets; | |
widgets.CalendarWidget = function (wrapper, settings) { | |
var self = this; |