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 logging | |
import odoo | |
from odoo import http | |
from odoo.tools import config | |
_logger = logging.getLogger(__name__) | |
# similar to odoo.http.db_monodb but forcing the PRODUCTION_DB database | |
# in case there are several databases and request (like portal/website) |
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 may want some translatable fields in your project becomes untranslatable | |
Here is how to produce code | |
Note: to be executed with odoo shell | |
""" | |
print('\n'.join( | |
["\n\nclass %s(models.Model):\n\t_inherit = '%s'\n\t%s = fields.%s(translate=False)" % ( | |
x.model.replace('.', ' ').title().replace(' ', ''), x.model, x['name'], x.ttype.capitalize()) |
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 -*- | |
# based on this code | |
# http://code.activestate.com/recipes/577423-convert-csv-to-xml/ | |
# convert Odoo csv files in xml files | |
# csv is easy to maintain but xml data have noupdate feature | |
# Limitations: | |
# - relation field One2many is NOT supported | |
# - csv should have 'id' as first column |
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 -*- | |
############################################################################## | |
# | |
# licence AGPL version 3 or later | |
# see licence in __openerp__.py or http://www.gnu.org/licenses/agpl-3.0.txt | |
# Copyright (C) 2014 Akretion (http://www.akretion.com). | |
# @author David BEAL <[email protected]> | |
# | |
############################################################################## |
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 -*- | |
""" | |
Script to update 'countries.py' if needed | |
""" | |
from lxml import objectify | |
import requests | |
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 | |
""" Convert vim snippets into komdo Edit/IDE snippets | |
http://www.activestate.com/komodo-edit | |
""" | |
""" | |
snippet browse | |
self.browse(cr, uid, ${1:ids}, context=context)${2} | |
======================================================= |
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 python | |
# -*- coding: utf-8 -*- | |
""" | |
This script allows to convert .bash_aliases file | |
in config.fish used by fish shell command line | |
see http://fishshell.com/ | |
""" | |