Odoo Aide

0

0
5 Answers
0
Avatar

Cybrosys Techno Solutions Pvt.Ltd

--Cybrosys Techno Solutions Pvt.Ltd--
Cybrosys Technologies
https://www.cybrosys.com
16252
| 7 6 10
Calicut, Inde
--Cybrosys Techno Solutions Pvt.Ltd--

Cybrosys Technologies is a private limited ISO certified company in Technology and Software Engineering sector. We serve as one of the best and trusted Odoo official partner, providing ultimate Customization and Implementation services in Odoo ERP. A frequent contributor to Odoo Apps, our customized free apps are downloaded by more than one lakh users. Most of our apps augment the potentialities of Odoo and are trending in the Odoo app store.

Cybrosys keeps privilege to be one among the finest Odoo Official Partners with 200+ free apps contribution towards the Odoo community. Cybrosys also stands number one in Odoo-social Media Integration empowering every kind of business solutions.

We are also enriched with highly skilled UI/UX technical experts for Developing, Implementing and Designing, thereby providing ultimate benefit to our customer base.

Today Cybrosys has reached par excellent in Odoo Implementation and allied services, proving its credibility and reliability. Our proven services are used by customers sprawling across 160+ countries including Middle East, African continents, UK, Germany, Spain, Thailand, Hong Kong, New Zealand, Australia, Malaysia, Singapore, Egypt etc.

We are rapidly expanding our base with robust quality management and business process re-engineering to meet the ultimate customer desire.

To know more about Cybrosys Technologies and our Odoo Apps, Kindly visit:

Cybrosys Technologies 

Odoo Apps 

And inbox us your queries to odoo@cybrosys.com

Cybrosys Techno Solutions Pvt.Ltd
30/01/2019 06:29

Hi,

Here if you are looking to automatically create a checkout for those employees who forget to check out, you can create a scheduled action and calls a python function and do it.

But make sure that it will not affect/cause any issue.

You can create a scheduled action by referring to this link:  Automated action in Odoo

Then in the Python function that the action calls,

not_checkout = self.env['hr.attendance'].search([('checkout', '=', False)])
for rec in not_checkout:
date_time = 'prefered date time here'
rec.check_out = date_time


If you check the above Python code you can see that attendance which is not checked out yet is fetched and a DateTime is given as checkout time.


In the search, method make sure that the current date's record is only fetched.

Thanks

0
Brian Oosterwijk
02/04/2019 06:09

Hi,

Somehow if I use this code the automatic check out is still not working. Can someone add a screenshot of their scheduled action?

0
Avatar
--Mitul Shingala--

Odoo Developer

Mitul Shingala
30/01/2019 07:00

 hello

create an schedule action and into that set the "Execute Every 1 Days", "Next Execution Date = datetime(datetime must be like 2018-01-01 00:00:00),   code = model.cron_set_attedance_checkout(), model= Attendance"

Python code: 

class hr_attendace(models.Model)

    _inherit = 'hr.attendance'

    @api.model

    def cron_set_attedance_checkout(self):
         records = self.search([('check_out', '=', False), ('check_in', '!=', False)]):

         for record in records:

            record.check_out = record.check_in
    

Poser une question
Writer
Étiquettes
Keep Informed
1 Abonné(e)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 eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now