Error with module c2c_date_in_so_line

Bug #1002914 reported by Virginie Laborie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Camptocamp Addons
Confirmed
Undecided
Unassigned

Bug Description

Hi,
I have install the module c2c_date_in_so_line on OpenERP version 6.1.1, but when I try to add a new product line on sale order I get the following error message "TypeError: product_id_change() got an unexpected keyword argument 'context'".
So we make modifications on the file sale.py from the module c2c_date_in_so_line.
     We add the argument context on the function product_id_change;
     See following our changes

****************************************************************************************
109 def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
110 uom=False, qty_uos=0, uos=False, name='', partner_id=False,
111 lang=False, update_tax=True, date_order=False, packaging=False,
112- fiscal_position=False, flag=False, planned_date=False):
+ fiscal_position=False, flag=False, context=None, planned_date=False):
        to_return = super(sale_order_line, self).product_id_change(
            cr, uid, ids, pricelist, product, qty,
            uom, qty_uos, uos, name, partner_id,
            lang, update_tax, date_order, packaging,
118 - fiscal_position, flag)
 + fiscal_position, flag, context)
        if not product :
            return to_return
        if planned_date :
            to_return['value']['planned_date'] = planned_date
        else :
            delay = self.pool.get('product.product').browse(cr,uid,product).sale_delay
            date = str(DateTime.now() + DateTime.DateTimeDeltaFromDays(delay))
            to_return['value']['planned_date'] = date
        return to_return
****************************************************************************************

After this modification we can add new product lines on sale order.

But now when we enter a date in the field soplanned_date and click on button_refresh_date, we have the following error :
" File "/home/openerp/addons-ateq/c2c_date_in_so_line/sale.py", line 68, in button_refresh_date
    line.write({'planned_date' : planned_date}, {})
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 368, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
TypeError: write() got multiple values for keyword argument 'context'"

Could you help us to use this module on version 6.1.1?

Regards
Virginie

Changed in c2c-addons:
status: New → Confirmed
assignee: nobody → Nicolas Bessi - Camptocamp (nbessi-c2c)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hello,

We never had any opportunity to migrate this module to the 6.1 version.
If you or someone do the necessary changes for this version (I think there is not so much to do), we'll be pleased to merge the proposal.

Thanks
Guewen

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.