Odoo Help

Welcome!

This community 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.

0

Why in functions called by fields.function(called_function,...) the field uid is always 1?

By
Anabela Damas
on 7/3/14, 6:06 AM 1,715 views

Hi, 

I'm trying to save who has changed the state of the invoice but in _get_invoice_user_edit the uid field is always equal to 1 (Administrator).

class account_invoice(osv.osv):

    def _get_invoice_user_edit(self, cr, uid, ids, field_name, arg, context=None):
        result = {}
       ..... 
       
        return result

_inherit = "account.invoice"
    _columns = {

 'invoice_user_edit': fields.function(_get_invoice_user_edit ,method=True, type="char", store={'account.invoice': (lambda self, cr, uid, ids, ctx={}: ids , ['state'], 9),}, string="User Edit"),

    }
    

Do you know how can I save this information ? 

Thanks

 

1

deep

--deep--
1617
| 5 4 7
Bengaluru, India
--deep--

Techno-Functional Associate with 6+ years of experience in Odoo (formerly known as OpenERP).

deep
On 7/15/14, 5:49 AM

Hi...

yes for functional.fields compute method will be evaluated by super admin only...

If you are using Version 7 or 8, use "track_visibility" attribute for a column, that way you will have a track of such things

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/3/14, 6:06 AM
Seen: 1715 times
Last updated: 3/16/15, 8:10 AM