Odoo Help


Unable to Confirm a sale order from user ?

on 8/13/13, 5:10 AM 3,939 views


I created one user under adminstrator. Now i want to conform a sale order from user. After logged on from user, Press a confirm button following error shown.

Scenario :, User should not approve a sale order value greater than 2.5 lakhs. For that i inherit a class, sale.config.setting , Code for your reference

class sale_config(osv.osv_memory):

_inherit = 'sale.config.settings'

_columns = {
    'quote_limit': fields.float('Sales Person limit for raising Sale order',
        help="To allow your salesman to make invoices for sales order lines amount for limit."),


class quote_approve_limit(osv.osv): _name= 'quote.approve.limit' _description =' Change the limit of quotation '

_columns = {
    'name' : fields.char('Description for Setting Quotation limit', size=128),
    'value' : fields.float('Limit', digits=(16,2)),


Validation in sale.py .

class sale_order(osv.osv):

""" Inherits Qutation insert field to validity date """

_inherit = 'sale.order'

def action_button_confirm(self, cr, uid, ids, context=None):

    a = self.browse(cr,uid, ids)[0]

    l_obj=self.pool.get('quote.approve.limit').search(cr,uid,[('id','=', 1)])

    l2= self.pool.get('quote.approve.limit').browse(cr,uid,l_obj[0])

    if a.amount_total > l2.value and uid != 1:
        raise osv.except_osv(_('Warning!'),_('You cannot confirm a sales order which has greater than 2.5 Lakhs. Need a approval from Higher Authority'))
        assert len(ids) == 1, 'This option should only be used for a single id at a time.'
        wf_service = netsvc.LocalService('workflow')
        wf_service.trg_validate(uid, 'sale.order', ids[0], 'order_confirm', cr)
    return True

Executed well, When i logged in as user and try to press confirm button it shows following error: Unable to confirm a sale order....

Access Denied Sorry, you are not allowed to access this document. Please contact your system administrator if you think this is an error. (Document model: quote.approve.limit)

Any solution for that error let me know.. Thanks in advance...

On 8/14/13, 5:25 AM


The problem solved by adding a object [quote.approve.limit] to group. To enable this goto Setting -> User -> Group -> choose Access Right tab -> Add a object [quote.approve.limit] and enable read and write check box. After i try to confirm the sale order its working fine. Can any one Say My solution is correct or not ?



About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/13/13, 5:10 AM
Seen: 3939 times
Last updated: 5/5/15, 10:11 AM