<meta property="og:title" content="title" />
<meta property="og:description" content="desc" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://url.com/" />
<meta property="og:image" content="http://url.com/image.jpg" />
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
<!-- http://ps.url/api/addresses --> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<prestashop> | |
<address> | |
<city>Lausanne Ouchy</city> | |
<id_manufacturer>13</id_manufacturer> | |
<firstname>Test</firstname> | |
<id_country>19</id_country> | |
<phone>123321321</phone> | |
<address1>Street 1</address1> |
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 time | |
def timeit(method): | |
"""Decorate methods to measure time.""" | |
def timed(*args, **kw): | |
print 'START', method.__name__ | |
ts = time.time() | |
result = method(*args, **kw) | |
te = time.time() |
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 WebsiteConfigSettings(models.TransientModel): | |
"""Override website config model.""" | |
_inherit = "website.config.settings" | |
my_new_field = fields.Char( | |
string='My field', | |
related='website_id.my_new_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
<!-- | |
you must have 2 fields on your model: | |
* the binary field `my_file` | |
* a char field for filename `my_file_fname` | |
--> | |
<field name="my_file" filename="my_file_fname" /> | |
<field name="my_file_fname" invisible="1" /> |
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
# remove all images "months" old | |
docker images -a | grep 'months ago' | awk '{print $3}' | xargs --no-run-if-empty docker rmi | |
# remove all dangling images | |
docker rmi $(docker images -f "dangling=true" -q) | |
# remove all containers "months" old | |
docker ps -a | grep 'months ago' | awk '{print $1}' | xargs --no-run-if-empty docker rm | |
# remove all containers exited |
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 _message_order_formatter(subj, line, changed, old): | |
"""Format mail msg for update order lines log. | |
@param subj: subject of the message | |
@param line: order line | |
@param changed: mapping of changed field values | |
@param old: mapping of old field values | |
""" | |
mess = subj + "<ul>" | |
for fname, value in changed.iteritems(): |
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
mydb=# select id, name, latest_version, published_version from ir_module_module where name = 'mymodule'; | |
id | name | latest_version | published_version | |
-----+-------------+----------------+------------------- | |
310 | mymodule | 9.0.2.0.1 | | |
(1 row) | |
mydb=# update ir_module_module set latest_version='9.0.1.0.1' where id = 310; |
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
[openerp] | |
eggs += nose | |
openerp_scripts = nosetests command-line-options=-d openerp-log-level=WARN |