Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I am trying to compare year from date picker with a year in dropdown (hardcoded year), so if it doesnt match "show error".
This is my code:
def _check_year_match(self, cr, uid, ids, context=None):
holiday_year = self.pool.get('holiday')
holiday_date_year = self.pool.get('holiday.line')
hol_year1 = holiday_year.browse(cr, uid,,context=context)
hol_year2 = holiday_date_year.search(cr, uid,,context=context)
cal_year = hol_year2.date_start('%Y',hol_year2.date_start(datetime, "%Y"))
for x in cal_year.browse(cr, uid, sr_ids, context=context):
if x.id != ids:
for self_obj in self.browse(cr, uid, ids, context=context):
if x.holiday_id == self_obj.holiday_id and x.year != cal_year:
I know this is some junk I have written. Please help.
Or is there a way where I can have a option to select only date and month.
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
|Asked: 1/10/15, 3:04 AM|
|Seen: 671 times|
|Last updated: 3/16/15, 8:10 AM|