Problem with override function module: sale_layout

Bug #788686 reported by Nicola Riolini - Micronaet
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 3

Bug Description

Hi, ubu 10.4, oerp 6.0.2, new db with sale_layout installed:
I see that function _amount_line is write in sale/sale.py module and sale_layout override it in sale_layout/sale_layout.py file
I put a pdb.set_trace() in both the function and I see that when I click compute botton in order form the method that is called is the sale one, no work on sale_layout

sale.py function:
class sale_order_line(osv.osv):
    def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
        tax_obj = self.pool.get('account.tax')
        cur_obj = self.pool.get('res.currency')
        res = {}
        if context is None:
            context = {}
        for line in self.browse(cr, uid, ids, context=context):
            price = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
            taxes = tax_obj.compute_all(cr, uid, line.tax_id, price, line.product_uom_qty, line.order_id.partner_invoice_id.id, line.product_id, line.order_id.partner_id)
            cur = line.order_id.pricelist_id.currency_id
            res[line.id] = cur_obj.round(cr, uid, cur, taxes['total'])
        return res

sale_layout function: <<<< here openerp don't pass!!!
class sale_order_line(osv.osv)
    def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
        res = {}
        for line in self.browse(cr, uid, ids, context=context):
            if line.layout_type == 'article':
                return super(sale_order_line, self)._amount_line(cr, uid, ids, field_name, arg, context)
        return res

Related branches

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Low
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Purnendu Singh (OpenERP) (purnendu-singh) wrote :

Hello Nicola Riolini,,

I have fixed the problem in lp:~openerp-dev/openobject-addons/trunk-bug-788686-psi branch, It will be merged in lp:openobject-addons very soon.

Revision No: 4733
Revision ID: <email address hidden>

Thanks
Purnendu singh

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
milestone: none → 6.1
Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
qdp (OpenERP) (qdp) wrote :

fix landed in trunk addons, in revision 5084

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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