Se usará Ubuntu 16.04 como sistema base
sudo apt-get update
sudo apt-get install git python-dev libpq-dev python-pip python-virtualenv libsasl2-dev libldap2-dev libssl-dev \| https://github.com/Yenthe666/auto_backup | |
| backup to server first | |
| sudo pip3 install pysftp | |
| # this is no good, it needs List_db to be True, but it's disabled for security purpose. Need another method. | |
| https://github.com/meganz/MEGAcmd/blob/master/contrib/docs/BACKUPS.md | |
| push local backup to mega cloud | |
| https://github.com/meganz/MEGAcmd/blob/master/UserGuide.md |
| Archivo replacer | |
| https://gist.github.com/umiphos/54658fafa9d70d9f58363a5bb96fe208 | |
| ./replacer.sh "account\.invoice" "account\.move" | |
| ./replacer.sh "AccountInvoice" "AccountMove" | |
| Esto se queda tal cual | |
| account.group_account_invoice |
| # -*- coding: utf-8 -*- | |
| import sys | |
| import datetime | |
| from os import path, pardir | |
| PROJECT_ROOT = path.dirname(path.abspath(__file__)) | |
| sys.path.append(path.join(PROJECT_ROOT, pardir)) | |
| import openpay | |
| openpay.api_key = "sk_c71babd865fd420b94bc588a8585c122" | |
| openpay.verify_ssl_certs = False |
| class TestCustom(Test): | |
| def __init__(self, methodName='runTest'): | |
| super(TestCustom, self).__init__(methodName) | |
| # Skip original test from inherited class | |
| custom_attributes = set(dir(TestCustom)) - set(dir(Test)) | |
| custom_test_methods = [ | |
| name for name in custom_attributes | |
| if name.startswith('test_') and callable(getattr(self, name))] | |
| if methodName not in custom_test_methods: | |
| method = getattr(self, methodName) |
| quants = env['stock.quant'].search([]) | |
| move_line_ids = [] | |
| warning = '' | |
| for quant in quants: | |
| move_lines = env["stock.move.line"].search([ | |
| ('product_id', '=', quant.product_id.id), | |
| ('location_id', '=', quant.location_id.id), | |
| ('lot_id', '=', quant.lot_id.id), | |
| ('package_id', '=', quant.package_id.id), | |
| ('owner_id', '=', quant.owner_id.id), |
| # This came up with a huge problem for days, but i resolve it. | |
| # The main problem is the limitation in form in odoo. Mostly of this are not in the official documentation, | |
| # so maybe you will feel a bit blind sometimes, but I feel you bro. | |
| # Basically works for partner_id relation for many2one | |
| # PART ONE | |
| # Create a class res_partner.py | |
| class ResPartner(models.Model): | |
| """This part is the easy part, @api.model overrides to name_get (optional) and name_search.""" | |
| _inherit = 'res.partner' |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """Script to bootstrap an Odoo database (8.0).""" | |
| import odoorpc | |
| # Odoo connection | |
| SUPER_PWD = 'admin' | |
| HOST = 'localhost' | |
| PORT = 8069 | |
| DB = 'my_db' |
| import os | |
| def split(filehandler, delimiter=',', row_limit=10000, | |
| output_name_template='output_%s.csv', output_path='.', keep_headers=True): | |
| """ | |
| Splits a CSV file into multiple pieces. | |
| A quick bastardization of the Python CSV library. | |
| Arguments: |
| #!/usr/bin/env python | |
| # | |
| # Very basic example of using Python and IMAP to iterate over emails in a | |
| # gmail folder/label. This code is released into the public domain. | |
| # | |
| # RKI July 2013 | |
| # http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/ | |
| # | |
| import sys | |
| import imaplib |