Odoo Help

0

0
6 Answers
2
Avatar

Jignesh Mehta India

--Jignesh Mehta--
12232
| 7 6 10
Surat, India
--Jignesh Mehta--
General Summary :-
- Odoo (Formerly OpenERP) Technical & Functional Expert.
- Worked as Project lead on Jewellery Manufacturing ERP.
- Having 3+ years of strong experience in odoo module development.
- Work for 3+ odoo customization to international & national clients.

Module Developments :-
- Develop Jewellery Manufacturing ERP from Scratch.
- Work in Several Modules like CRM, Sales, Purchase, Account, Inventory HR, Payroll, Website, etc.
- Work in Odoo themes which is Business and E-commerce.

Report Development :-
- Develop several Qweb and Excel Reports.

Code Migration :-
- Migrate code from Odoo9.0 to Odoo12.0 of Jewellery Manufacturing ERP.
Jignesh Mehta India
6/29/16, 8:30 AM

Hello Uppili,


Try below code :-


@api.multi

def unlink(self):

    res = super(hr_attendance, self).unlink()

    return self.return_action_hr_attendance()


def return_action_hr_attendance(self):

     model_obj = self.env['ir.model.data']

     data_id = model_obj._get_id('module_name', 'hr_attendance_tree_id')

     view_id = model_obj.browse(data_id).res_id

     return {

          'type': 'ir.actions.client',

          'tag': 'reload',

          'name': _('Attendance'),

          'res_model': 'hr.attendance',

          'view_type': 'tree',

         'view_mode': 'tree',

         'view_id': view_id,

         'target': 'current',

         'nodestroy': True,

     }


Hope it works for you.

Thanks,

3 Comments
Uppili Arivukkannu India
6/29/16, 8:54 AM

Thanks for your reply.

Your code deletes the record but the page is not refreshing.

data_id = model_obj._get_id('hr_attendance', 'view_attendance_who')

Uppili Arivukkannu India
6/29/16, 9:30 AM

When I give this method in return_action_hr_attendance in button. While I pressing that button the page is getting refreshed but while deleting the page is not refreshing.

Uppili Arivukkannu India
6/29/16, 9:36 AM

The same is happening in both of our codes. While passing through unlink() the page refresh is not happening.

1
Avatar

Axel Mendoza Cuba

--Axel Mendoza--
13808
| 8 8 10
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full-time employee trying to understand what to do and how

Reach me at aekroft@gmail.com

Axel Mendoza Cuba
6/29/16, 7:07 PM

You need an auto_refresh solution like:

https://github.com/aek/odoo_public/tree/8.0/addons/solt_autorefresh

because the unlink will not trigger any reload and even if it does, it will be for the current user, not for others users

Ask a Question
Keep Informed
1 follower(s)
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.

Register
Odoo Training Center

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

Test it now