Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Data;
using System.Diagnostics;
// This was lifted directly from the MS website here: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.debug?view=netcore-3.1#examples
//class Test
//{
//static void Main()
//{
@WeeDom
WeeDom / debug
Last active April 27, 2020 14:09
debug output (from the pandas.read_csv)
$ python usertweets.py
b'Skipping line 8: expected 1 fields, saw 6\nSkipping line 9: expected 1 fields, saw 2\nSkipping line 19: expected 1 fields, saw 4\nSkipping line 20: expected 1 fields, saw 3\nSkipping line 22: expected 1 fields, saw 2\nSkipping line 30: expected 1 fields, saw 2\nSkipping line 33: expected 1 fields, saw 2\nSkipping line 39: expected 1 fields, saw 2\n'
Pandas(Index=0, _1='Dictionary')
> /Users/dominic.pain/challenges/05/usertweets.py(70)<module>()
-> for row in df.itertuples():
(Pdb) row
Pandas(Index=0, _1='Dictionary')
(Pdb) row.text
@WeeDom
WeeDom / __init__.py
Last active September 27, 2019 12:32
Tests not running
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import common # noqa: F401
from . import test_project_template # noqa: F401
# from . import test_sale_service
# from . import test_project_billing
# from . import test_reinvoice
# from . import test_reporting
class ResPartner(models.Model):
_inherit = "res.partner"
current_draft_invoice = fields.Many2one('account.invoice',
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_partner_account_invoice_draft" model="ir.ui.view">
#get user ID
logger.debug('Logging into ' + commonUrl)
try:
sock_common = client.ServerProxy(commonUrl)
logger.debug("dbname: {}, user: {}, pass: {}".format(dbname,username,pwd))
uid = sock_common.login(dbname, username, pwd)
except ConnectionRefusedError:
$.ajax({
url: "/preview_report_pdf",
type: "POST",
dataType: 'json',
@WeeDom
WeeDom / controller.py
Created July 17, 2019 10:53
response not serializable
from odoo import http
from odoo.http import request, Response
class PdfPreview(http.Controller):
odoo.define('web_editor_pagebreak.pdf_preview.js', function (require) {
"use strict";
var form_widget = require('web.form_widgets');
@WeeDom
WeeDom / gist:7c759a298392eda3273b47a1bb307239
Created June 13, 2019 15:46
odoo error when upgrading "web" module
UnicodeEncodeError: 'ascii' codec can't encode character '\xd7' in position 474: ordinal not in range(128)
Call stack:
File "/usr/lib/python3.5/threading.py", line 882, in _bootstrap
self._bootstrap_inner()
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.5/socketserver.py", line 625, in process_request_thread
self.finish_request(request, client_address)