Community mailing list archives

Re: ProgrammingError: column "delivery_date_order" of relation "stock_invoice_onshipping" does not exist

- 11/24/2014 09:11:29
I'm not sure about this solution, but have you done an update of the database ? For example an update -a (all) to be sure ?

This error means that the column has not been created in the database. If you do the update, all the database tables will be updated to reflect the python code.

I also had this peculiar problem with a custom class that inherited from an AbstractModel in v8, but I don't think this is your case.

On Mon, Nov 17, 2014 at 11:12 AM, Marco Neumann <> wrote:

Hi All,

Im looking for some guidens an tips.
Thanks in advance. :-)

My goal is to have a delivery date on the invoice.

This delivery date wil be set true view "Create Draft invoice" below the field "invoice date".

Untill the view to set the invoice date it works. ( creat draft invoice)
The field "delivery date" is shown with default date (now). so far so good.

But after clicking 'make' i get above error. ( see all text error below this mail)

What am i missing??

I did the following:

- Add custom field "delivery_date_order" in model account.invoice
- customize like so:

class stock_invoice_onshipping(osv.osv_memory):
    _name = "stock.invoice.onshipping"
    _inherit = "stock.invoice.onshipping"
    _columns = {
        'journal_id': fields.selection(_get_journal_id, 'Destination Journal',required=True),
        'group': fields.boolean("Group by partner"),
        'invoice_date':'Invoiced date'),
        'delivery_date_order':'Leverdatum'),   ### i added this ###

    _defaults = {
        'journal_id' : _get_journal,
        'delivery_date_order':'%Y-%m-%d'),   ### i added this ###

def create_invoice(self, cr, uid, ids, context=None):
        if context is None:
            context = {}
        picking_pool = self.pool.get('stock.picking')
        onshipdata_obj =, uid, ids, ['journal_id', 'group', 'invoice_date','delivery_date_order'])  ### i added this ###
        if context.get('new_picking', False):
            onshipdata_obj['id'] = onshipdata_obj.new_picking
            onshipdata_obj[ids] = onshipdata_obj.new_picking
        context['date_inv'] = onshipdata_obj[0]['invoice_date']
        context['date_order'] = onshipdata_obj[0]['delivery_date_order'### i added this ###
        active_ids = context.get('active_ids', [])
        active_picking = picking_pool.browse(cr, uid, context.get('active_id',False), context=context)
        inv_type = picking_pool._get_invoice_type(active_picking)
        context['inv_type'] = inv_type
        if isinstance(onshipdata_obj[0]['journal_id'], tuple):
            onshipdata_obj[0]['journal_id'] = onshipdata_obj[0]['journal_id'][0]
        res = picking_pool.action_invoice_create(cr, uid, active_ids,
              journal_id = onshipdata_obj[0]['journal_id'],
              group = onshipdata_obj[0]['group'],
              type = inv_type,
        return res




OpenERP Server Error

Client Traceback (most recent call last):
  File "/opt/openerp/v7/web/addons/web/", line 204, in dispatch
    response["result"] = method(self, **self.params)
  File "/opt/openerp/v7/web/addons/web/controllers/", line 1128, in call_kw
    return self._call_kw(req, model, method, args, kwargs)
  File "/opt/openerp/v7/web/addons/web/controllers/", line 1120, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/opt/openerp/v7/web/addons/web/", line 42, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
  File "/opt/openerp/v7/web/addons/web/", line 30, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/opt/openerp/v7/web/addons/web/", line 103, in send
    raise xmlrpclib.Fault(, formatted_info)

Server Traceback (most recent call last):
  File "/opt/openerp/v7/web/addons/web/", line 89, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/opt/openerp/v7/server/openerp/", line 296, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp/v7/server/openerp/service/", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp/v7/server/openerp/osv/", line 190, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/openerp/v7/server/openerp/osv/", line 132, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/openerp/v7/server/openerp/osv/", line 199, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/openerp/v7/server/openerp/osv/", line 187, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/openerp/v7/server/openerp/osv/", line 4515, in create
    cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
  File "/opt/openerp/v7/server/openerp/", line 161, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/openerp/v7/server/openerp/", line 226, in execute
    res = self._obj.execute(query, params)
ProgrammingError: column "delivery_date_order" of relation "stock_invoice_onshipping" does not exist
LINE 1: ...shipping" (id,"group","invoice_date","journal_id","delivery_...


Post to: