Skip to content

Instantly share code, notes, and snippets.

class UUID(Field):
""" Encapsulates an :class:`UUID`. """
type = 'uuid.UUID'
column_type = ('uuid', 'uuid')
def convert_to_column(self, value, record, values=None, validate=True):
return str(value)
def convert_to_cache(self, value, record, validate=True):
return str(value)
version: '2'
services:
web:
image: odoo:12.0
depends_on:
- db
ports:
- "8069:8069"
volumes:
- odoo-web-data:/var/lib/odoo
# Part of OBA40. See LICENSE file for full copyright and licensing details.
import signal
import sys
import odoo
from odoo.tools import config
from . import Command
_logger = logging.getLogger(__name__)
class OdooFatturaElettronica(models.Model):
_inherit = 'account.invoice'
state = fields.Selection(selection_add=[
('waiting', 'Waiting'),
('send_sdi', 'Send SDI'),
])
electronic_invoice_state = fields.Selection([
@gigidn
gigidn / Event
Last active April 18, 2020 08:34
def notify(func):
""" Decorator that enables methods of a model to publish messages through NATS."""
def wrapper(*args):
db_name = args[0].env.cr.dbname
table_name = args[0]._table
# TODO: For the moment we are using a testing subject
subject = 'account.journal'
print("wrapper_notify")
apt-get update \
&& apt-get install -y --no-install-recommends \
python3-pip \
python3-setuptools \
python3-renderpm \
python3-babel \
python3-dateutil \
python3-decorator \
python3-docutils \
python3-feedparser \
@gigidn
gigidn / wiz_export_invoices.py - view.xml
Last active February 6, 2019 19:47
esportazione fatture
# -*- coding: utf-8 -*-
# Part of Teuron Odoo Addons. See LICENSE file for full copyright and licensing details.
import base64
import io
import zipfile
import datetime
from odoo import api, fields, models, tools, _
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 KTec S.r.l.
# (<http://www.ktec.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.