Rule_RETURN dependency sale_journal_picking_stats

Asked by maddus

Hi,

i tryed to install magentoerpconnect but i got this failure:

Environment Information :
System : Windows-XP-5.1.2600-SP3
OS Name : nt
Operating System Release : XP
Operating System Version : 5.1.2600
Operating System Architecture : 32bit
Operating System Locale : de_DE.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 5.0.7
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 244, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 73, in __call__
    return getattr(self, method)(*params)
  File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 632, in execute
    return self._execute(db, uid, wiz_id, datas, action, context)
  File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 612, in _execute
    return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context)
  File "/usr/lib/python2.5/site-packages/openerp-server/wizard/__init__.py", line 178, in execute
    res = self.execute_cr(cr, uid, data, state, context)
  File "/usr/lib/python2.5/site-packages/openerp-server/wizard/__init__.py", line 73, in execute_cr
    action_res = action(self, cr, uid, data, context)
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/base/module/wizard/wizard_module_upgrade.py", line 92, in _upgrade_module
    db, pool = pooler.restart_pool(cr.dbname, update_module=True)
  File "/usr/lib/python2.5/site-packages/openerp-server/pooler.py", line 62, in restart_pool
    return get_db_and_pool(db_name, force_demo, status, update_module=update_module)
  File "/usr/lib/python2.5/site-packages/openerp-server/pooler.py", line 40, in get_db_and_pool
    addons.load_modules(db, force_demo, status, update_module)
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/__init__.py", line 740, in load_modules
    r = load_module_graph(cr, graph, status, report=report)
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/__init__.py", line 584, in load_module_graph
    init_module_objects(cr, package.name, modules)
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/__init__.py", line 367, in init_module_objects
    result = obj._auto_init(cr, {'module': module_name})
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/magentoerpconnect/sale.py", line 140, in _auto_init
    cr.execute("ALTER TABLE sale_order_line ALTER COLUMN discount TYPE numeric(16,6);")
  File "/usr/lib/python2.5/site-packages/openerp-server/sql_db.py", line 77, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/openerp-server/sql_db.py", line 122, in execute
    res = self._obj.execute(query, params)
NotSupportedError: FEHLER: Typ einer Spalte, die von einer Sicht oder Regel verwendet wird, kann nicht geändert werden
DETAIL: Regel _RETURN für Sicht sale_journal_picking_stats hängt von Spalte »discount« ab

Dependency is everything ok. I translated the failure: Rule_RETURN for visual sale_journal_picking_stats depends on column »discount«

Sorry for my english, but i hope that you could understand me.

Greetings
maddus

Question information

Language:
English Edit question
Status:
Solved
For:
Magento OpenERP Connector Edit question
Assignee:
No assignee Edit question
Solved by:
maddus
Solved:
Last query:
Last reply:
Revision history for this message
maddus (maddusito) said :
#1

I tryed it with a new database and no more problem.

Revision history for this message
dleigh (david-leighweb) said :
#2

I'm actually having a problem having OpenERP create a database after I've created the first one (Windows All-in-one install). So I downloaded pgadmin and tried to track down the sql problem. What I did that worked for me was to:

Save the SQL for creating the rule on the sale_journal_invoice_type_stats view
Save the SQL for creating the view sale_journal_invoice_type_stats
Save the SQL for creating the rule on the sale_journal_picking_stats view
Save the SQL for creating the view sale_journal_picking_stats

Drop those 2 views

Run the install

Run the sql that I'd saved

That worked for me, but it underlines that the code in sale.py near line 139:

    def _auto_init(self, cr, context={}):
        cr.execute("ALTER TABLE sale_order_line ALTER COLUMN discount TYPE numeric(16,6);")
        cr.execute("ALTER TABLE account_invoice_line ALTER COLUMN discount TYPE numeric(16,6);")
        super(sale_order, self)._auto_init(cr, context)

is faulty if either of those two view exist. I'm completely new to openerp so I can't tell you which thing installs those two views or their rules. They are perhaps installed because of a particular choice I made in the configuration and/or initial profile. (I'm using openerp-allinone-setup-5.0.7).

So, developers, please either add some help to guide those who are openerp ignorant as to what to install first, or fix sale.py to take into account those two views.

By the way, I'm only installing openerp because I first have magento and want the value of erp/crm that's connected to magento. I imagine many more ignorant openerp newbies are going to show up via the magento door...especially if this connector really works! That's my next task...;c)