I d like to find a way to search invoices by a month taken from invoice number and ive got a problem with getting only a month from invoice date.
res = self.search([('type','=',inv_type),('date_invoice.!-month-!','=',number[5:7]),('date_invoice','>',date_invoice),('number','<',number), ('journal_id','=',journal)])
if res:
raise except_orm(('Warning!'), ('Change date!'))