lasarux / ooop Goto Github PK
View Code? Open in Web Editor NEWOpenObject On Python
License: GNU General Public License v3.0
OpenObject On Python
License: GNU General Public License v3.0
What do you think about commit 4b7707c of my master branch? This let's you to call custom function when you use OOOP inside OpenERP with pool.
Cheers,
add this featured :D
I don't know how to filter and return ordened object. It's avaible this feature?
Change the localhost in OOOP init to URI to be able to use https or other port number
the save method use the auto-generated fake id for saving related instances leading to:
'One of the records you are trying to modify has already been deleted (Document type: Partner Addresses)
Hello, in the documentation i can't see the onchange methods API support it?
Regards,
Hi, when you try to get a object with .get and the parameter isnΒ΄t integer, the function return a valid object but with false attributes.
Hi there... great idea, I look forward to contributing. Looking to incorporate into Django to simplify things a touch.
Anyhow, I've got an issue when using all() with a large number of records. Actually, it's a large number of analytic accounts (1000+) and I'm attempting to do:
res_users.all()
Because of the large number of AA's, a very large select shows up in pg_stat_activity:
SELECT DISTINCT("user") FROM account_analytic_analysis_summary_user WHERE account_id in
In my test environment I've let it spin for a while but eventually had to kill the process.
I took a brief peek at the code but I'm not entirely clear on how the recursive is happening (load_models?)
type object 'datetime.date' has no attribute 'strptime'
ooop.py
line 575
self.dict[name] = date.strptime(data[name], "%Y-%m-%d")
change for:
self.dict[name] = datetime.strptime(data[name], "%Y-%m-%d")
The save_all doesn't work.
The problem is when i make a related object internally its created in a new instance, so in the save time, the main object doesn't have access to the related object to save it.
Comes from Issue #19
xmlrpc just supports 32bit integers on a 64bit machine python id functions return a 64 number as object id when it creates a new instance of openerp object and is not automatically saved or is not manually saved it trys to send the number on to the server giving a OverFlow error.
This call finish with this error:
[...] /usr/lib/python2.6/httplib.pyc in readheaders(self) 263 firstline = 1 264 startofline = unread = tell = None --> 265 if hasattr(self.fp, 'unread'): 266 unread = self.fp.unread 267 elif self.seekable:
AttributeError: '_fileobject' object has no attribute 'unread'
To use a tdd methodology is a better approach for development
Please can you upload the ooop package to Pypi?
I use it in other project and could be great it installs ooop by dependence downloading it from pypi.
Thanks
When we create a new model the Data class assigns a negative id
self._ref = -id(self)
On the new method all the M2O, M2M, O2M are assign with a new object of the relation type. If we never save or change the value of the attribute the object keeps the negative id.
DEBUG [create]: res.partner {'supplier': True, 'customer': False, 'property_account_position': -4506685520, 'employee': False, 'lang': 'es_ES', 'vat_subjected': False, 'credit': False, 'debit_limit': False, 'address': [(6, 0, [165])], 'company_id': 1, 'property_account_receivable': 483, 'property_account_payable': 471, 'property_stock_customer': 9, 'credit_limit': False, 'debit': False, 'property_stock_supplier': 8, 'property_payment_term': -4506762320, 'property_product_pricelist': 1, 'ref': '2', 'active': True, 'name': 'XXXX'}
As you can see
'property_account_position': -4506685520
'property_payment_term': -4506762320
So when i try to save i got this error
OverflowError: int exceeds XML-RPC limits
The problem is that even on 64 bits xmlrpc has a 32bit maxsize
>>> import xmlrpclib
>>> xmlrpclib.MAXINT
2147483647L
32bit python maxint is same
>>> import sys
>>> sys.maxint
2147483647
in 64 python maxint fo python is
Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.maxint
9223372036854775807
Solutions
1- On save() all the M2O, O2M, M2M that has not been initialized should be False (which i think is the best option)
2- Create for id a negative number based on xmlrpc.maxint to not OverFlow the value
Mean time for executing scripts theres a option that forces to use 32 bits interpreter instead of the 64 one
export VERSIONER_PYTHON_PREFER_32_BIT=yes
Many2One fields aren't loaded and not showed at all in Data instance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.