Purchase order fiscal position

Bug #1061494 reported by ERPSystems.ro on 2012-10-04
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Low
OpenERP Publisher's Warranty Team
OpenERP Community Backports (Addons)
Undecided
Unassigned
6.1
Undecided
Unassigned

Bug Description

onchange_product_id() got an unexpected keyword argument 'fiscal_position_id'

Needs refactoring of onchange_product_id() and onchange_product_uom() from purchase order line.

Create a new purchase order, try to create a new purchase order line(even from client and web) it will raise an error

2012-10-04 09:27:44,492 21014 ERROR ? openerp.osv.osv: Uncaught exception
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/openerp-6.1-py2.7.egg/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openerp-6.1-py2.7.egg/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/openerp-6.1-py2.7.egg/openerp/addons_6.1/audittrail/audittrail.py", line 495, in execute_cr
    return fct_src(cr, uid, model, method, *args)
  File "/usr/local/lib/python2.7/dist-packages/openerp-6.1-py2.7.egg/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/openerp-6.1-py2.7.egg/openerp/addons_6.1/purchase/purchase.py", line 710, in onchange_product_uom
    name=name, price_unit=price_unit, notes=notes, context=context)
TypeError: onchange_product_id() got an unexpected keyword argument 'fiscal_position_id'
2012-10-04 09:27:44,493 21014 ERROR ? openerp.netsvc: onchange_product_id() got an unexpected keyword argument 'fiscal_position_id'

We are using Openerp 6.1 with the latest revision of server, addons...

I tried on runbot too and it raised the same error.

Related branches

Download full text (3.6 KiB)

I don't think it;s a duplicate of...because it doesn't have anything to do
with audit ...i unninstall the audittrail module and it didn't changed
anything...a put audit rules for purchase order, purchase order line and
the same result.

The only thing that work is to modify the function from purchase_order_line
class

    def onchange_product_uom(self, cr, uid, ids, pricelist_id, product_id,
qty, uom_id,
            partner_id, date_order=False, fiscal_position_id=False,
date_planned=False,
            name=False, price_unit=False, notes=False, context=None):
        """
        onchange handler of product_uom.
        """
        if not uom_id:
            return {'value': {'price_unit': price_unit or 0.0, 'name': name
or '', 'notes': notes or'', 'product_uom' : uom_id or False}}
        return self.onchange_product_id(cr, uid, ids, pricelist_id,
product_id, qty, uom_id,
- partner_id, date_order=date_order,
fiscal_position_id=fiscal_position_id, date_planned=date_planned,
+ partner_id, date_order=date_order, date_planned=date_planned,
            name=name, price_unit=price_unit, notes=notes, context=context)

Hope to improve in the addons.

On Thu, Oct 4, 2012 at 1:42 PM, Amit Bhavsar (Open ERP) <
<email address hidden>> wrote:

> *** This bug is a duplicate of bug 1055813 ***
> https://bugs.launchpad.net/bugs/1055813
>
> ** This bug has been marked a duplicate of bug 1055813
> [Trunk/6.1]Cannot add category to employee with audittrail
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1061494
>
> Title:
> Purchase order fiscal position
>
> Status in OpenERP Addons (modules):
> New
>
> Bug description:
> onchange_product_id() got an unexpected keyword argument
> 'fiscal_position_id'
>
> Needs refactoring of onchange_product_id() and onchange_product_uom()
> from purchase order line.
>
> Create a new purchase order, try to create a new purchase order
> line(even from client and web) it will raise an error
>
> 2012-10-04 09:27:44,492 21014 ERROR ? openerp.osv.osv: Uncaught exception
> Traceback (most recent call last):
> File
> "/usr/local/lib/python2.7/dist-packages/openerp-6.1-py2.7.egg/openerp/osv/osv.py",
> line 121, in wrapper
> return f(self, dbname, *args, **kwargs)
> File
> "/usr/local/lib/python2.7/dist-packages/openerp-6.1-py2.7.egg/openerp/osv/osv.py",
> line 176, in execute
> res = self.execute_cr(cr, uid, obj, method, *args, **kw)
> File
> "/usr/local/lib/python2.7/dist-packages/openerp-6.1-py2.7.egg/openerp/addons_6.1/audittrail/audittrail.py",
> line 495, in execute_cr
> return fct_src(cr, uid, model, method, *args)
> File
> "/usr/local/lib/python2.7/dist-packages/openerp-6.1-py2.7.egg/openerp/osv/osv.py",
> line 164, in execute_cr
> return getattr(object, method)(cr, uid, *args, **kw)
> File
> "/usr/local/lib/python2.7/dist-packages/openerp-6.1-py2.7.egg/openerp/addons_6.1/purchase/purchase.py",
> line 710, in onchange_product_uom
> name=name, price_unit=price_unit, notes=notes, context=context)
> TypeError: onchange_product_id() got an unexpected keyw...

Read more...

Hello Fekete Mihai,

I have double check this Issue. It's produce when audittrail Install. otherwise It's working fine. That's why I have attached the video for you reference. would you please check It. Hope this will help for you.

Correct me If I am wrong!

Thanks.

Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)

This issue can be reproduced after installing the module, warning.

Actual problem is due to wrong default parameter passed(fiscal_position instead of fiscal_position_id) to the onchange_product_id() for purchase_order_line class.

I will soon link a branch with the fix.

Thanks.

Changed in openobject-addons:
status: Confirmed → Won't Fix
status: Won't Fix → In Progress

Issue has been fixed in,
Branch: lp:~openerp-dev/openobject-addons/6.1-opw-580021-rgo
Rev-id: <email address hidden>
Rev-no: 7024

It will soon be reviewed and merged with main stable branch.

Thanks.

Changed in openobject-addons:
status: In Progress → Fix Committed
RpJ (repejota) on 2012-10-19
Changed in openobject-addons:
status: Fix Committed → Confirmed
status: Confirmed → Fix Committed
Rudolf Schnapka (rs-t3) wrote :

fix works for me. Also had the warning module causing this problem.
Just FYI &
Thanks for the fix!

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

Duplicates of this bug

Other bug subscribers