How can I configure an interface for searching events by specific dates on the website?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
Hi,
For this, you need a customization.
1.First, you must set up a calendar view on your website.
2. The following step is to compare the event date to the calendar date.You must obtain the event start date for that from the module "event.event."Consequently, you must use the js file to execute a rpc query.
py file:-
class EventEvent(models.Model):
_inherit = "event.event"
def get_calendar_date(self):
event = self.env['event.event'].sudo().search([])
event_date = self.env["event.event"].search([]).mapped('date_begin')
event_lst=[]
for rec in event:
a = {
'name': rec.name,
'url': rec.website_url,
}
event_lst.append(a)
a = {}
values={
'event_date':event_date,
'name_url':event_lst
}
return values
in js:-
await rpc.query({
model: 'event.event',
method: 'get_calendar_date',
args: [ ,],
}).then((res) => {
event_name= res['name_url'].map(event => event.name)
url =res['name_url'].map(event => event.url);
event_date = res['event_date']
dateOnly = res['event_date'].map(dateStr => {
const date = new Date(dateStr);
return date.toISOString().split('T')[0];
});
});
Here you got the date and you can easily compare it
Regards
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
1
lip 25
|
1724 | ||
|
2
sty 25
|
2179 | ||
|
1
maj 24
|
2334 | ||
|
0
mar 23
|
2459 | ||
|
0
lut 23
|
1627 |