Skip to content

Instantly share code, notes, and snippets.

View lukebranch's full-sized avatar

Luke Branch lukebranch

View GitHub Profile
# BASED ON - http://www.schenkels.nl/2014/12/reverse-proxy-with-odoo-8-nginx-ubuntu-14-04-lts/
upstream odoo8example {
server 127.0.0.1:8069 weight=1 fail_timeout=3000;
}
upstream odoo8example-im {
server 127.0.0.1:8072 weight=1 fail_timeout=0;
}
server {
[options]
; This is the password that allows database operations:
admin_passwd = mysupersecretpasswordmysupersecretpasswordmysupersecretpasswordmysupersecretpasswordmysupersecretpassword
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /usr/lib/python2.7/dist-packages/openerp/addons
# logfile = /var/log/odoo/odoo-server.log
addons_path=/odoo/odoo-server/addons,/odoo/custom/addons,/odoo/custom/JayVora-SerpentCS/9.0/MassEditing,/odoo/custom/biztech,/odoo/custom/oca/9.0/web,/odoo/custom/yenthe666/Aeroo,/odoo/custom/oca/9.0/server-tools,/odoo/custom/Elico-Corp/9.0/l10n-china,/odoo/custom/Elico-Corp/9.0/alipay/l10n-china,/odoo/custom/lukebranch,/odoo/custom/oca/9.0/management-system,/odoo/custom/oca/9.0/hr,/odoo/custom/oca/9.0/knowledge,/odoo/custom/oca/9.0/contract,/odoo/custom/oca/9.0/website,/odoo/custom/JayVora-SerpentCS/9.0/MassEditing,/odoo/custom/oca/9.0/product-attribute,/odoo/custom/OmniaSolutions,/odoo/custom/oca/9.0_unmerged/report-print-send,/odoo/custom/oca/9.0_unmerged
# BASED ON - http://www.schenkels.nl/2014/12/reverse-proxy-with-odoo-8-nginx-ubuntu-14-04-lts/
upstream odoo8swi {
server localhost:8069 weight=1 fail_timeout=3000;
}
upstream odoo8swi-im {
server localhost:8072 weight=1 fail_timeout=0;
}
server {
@lukebranch
lukebranch / gist:917f1cb9de091bb2582c
Created August 21, 2015 06:36
WE-G009-WET-12 Image example in base64 format
/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAQABAADASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3+iii gAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKA CiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAK KKKACiiigAooooAKKKKACii
@lukebranch
lukebranch / gist:0cdef0d5141b07460604
Created April 25, 2015 05:29
Aeroo Reports: Error while generating the report. "public" not defined "public" not defined For more reference inspect error logs. <type 'exceptions.Exception'>,Aeroo Reports: Error while generating the report. "public" not defined "public" not defined For more reference inspect error logs.,<traceback object at 0x7fa0c6186cf8>
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 530, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 567, in dispatch
result = self._call_function(**self.params)
@lukebranch
lukebranch / gist:4d84e39ee4ce4ec579a3
Created April 24, 2015 11:08
mass_editing: TypeError: 'NoneType' object is not callable
Traceback (most recent call last):
File "/opt/odoo/odoo-server/openerp/http.py", line 530, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo-server/openerp/http.py", line 567, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo-server/openerp/http.py", line 303, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/http.py", line 300, in checked_call
@lukebranch
lukebranch / gist:ac1fa483f608ce5cb9fd
Created April 1, 2015 14:23
TypeError: write() got an unexpected keyword argument 'context'
Traceback (most recent call last):
File "/opt/odoo/odoo-server/openerp/http.py", line 530, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo-server/openerp/http.py", line 567, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo-server/openerp/http.py", line 303, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/http.py", line 300, in checked_call
@lukebranch
lukebranch / gist:6109989e6048ad313f63
Created April 1, 2015 10:36
report_aeroo_direct_print : NameError: global name 'context' is not defined
Traceback (most recent call last):
File "/opt/odoo/odoo-server/openerp/http.py", line 530, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo-server/openerp/http.py", line 567, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo-server/openerp/http.py", line 303, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/http.py", line 300, in checked_call
Here's a link to my answer here:
https://github.com/OdooCommunityExamples/B2B_Add_To_Cart_Example
I've put together an incredibly basic module with only the functionality needed for what you have asked in this question.
I have added the view change (that snippet) into an xml file in a subdirectory called 'views' to organise it properly. Fundamentally you just need an __init__.py file, an __openerp__.py file with your dependencies (in this case website_sale, etc.), and your view definition (in this case /views/B2B_Add_To_Cart.xml).
Inside this XML file you just need to place your <template> tags nested inside the opening and closing <openerp> and <data> tags. Remember that you are working with XHTML/XML, and therefore opening and closing tags must be properly nested or you will run into problems.
@lukebranch
lukebranch / gist:efd6cb2e1b10441361a3
Created January 9, 2015 05:41
theme_clean installation traceback on 8.0
Odoo Server Error
Traceback (most recent call last):
File "/opt/odoo/odoo-server/openerp/http.py", line 524, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/opt/odoo/odoo-server/openerp/http.py", line 545, in dispatch
result = self._call_function(**self.params)
File "/opt/odoo/odoo-server/openerp/http.py", line 301, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs)