Hello. I cant solve one task:
I have menu called "limited dates" in module called "characteristics" where I can add certain dates and there is field in another module called first_payment_date. I need to set validation error when someone will set date simillar to "limited date" but its in another module. how can i solve this?
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- CRM
- e-Commerce
- Kirjanpito
- Varastointi
- PoS
- Project
- MRP
Tämä kysymys on merkitty
you can make a function like given below in model where first_payment_date defined:
        @api.constrains('first_payment_date')
        def _check_first_payment_date(self):
                dates = self.env['limited.dates'].search([])
                for rec in self:
                        if rec.date:
                                limited_date_id = self.env['limited.dates'].search([('limited_date','=',rec.date)])
                                if limited_date_id:
                                        raise ValidationError(_("You cannot set date set in limited dates!"))
Thanks & Regards,
CandidRoot Solutions Pvt. Ltd.
Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat
Nautitko keskustelusta? Älä vain lue, vaan osallistu!
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
Rekisteröidy| Aiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
|---|---|---|---|---|
|  | 2 elok. 23  | 3761 | ||
|  | 3 huhtik. 23  | 2805 | ||
|  | 3 jouluk. 22  | 34632 | ||
|  | 1 maalisk. 15  | 7525 | ||
|  | 1 maalisk. 15  | 5635 | 
