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.

1

how to show account status symbol in form?

By
Alby Antony
on 4/6/15, 1:09 AM 394 views

hai 

i want to show a status feild on the user. i have a table for the payments the user made and have an invoice table. if there are pending payments then the account status need to be inactive and if no pending payment then the user is active. how this can be done?

 

3

Akhil P Sivan

--Akhil P Sivan--
3423
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 4/6/15, 2:56 AM

Hi, you can use a functional field( a compute field in new api) for that. So in the function you can perform all the calculations based on the payments and return a status value, which will be displayed on the user profile.

For Eg:

class custom_res_partner(models.Model):

     _inherits = 'res.partner'

    status = fields.Boolean(compute='_check_status', string="Status")

   

    def _check_status(self):

        for rec in self:

            if payment_done:            // do your calculations based on payments

                   rec.status =True

            else:

                   rec.status = False

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: 4/6/15, 1:09 AM
Seen: 394 times
Last updated: 4/13/15, 6:57 AM