Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
5228 Lượt xem

Hello

When I have a click on a calendar view in my module I get this error:


Uncaught TypeError: Cannot read property 'type' of undefined

http://localhost:8069/web_calendar/static/src/js/web_calendar.js:691


Code for Classes 


class vetclinic_animal(osv.Model):

_name = "vetclinic.animal"

_columns = {

"name": fields.char("Name", size=64, required = True),

"birthdate" : fields.date("Birth Date"),

"classification_id": fields.many2one("vetclinic.classification", "Classification" , required = True),

"breed_id": fields.many2one("vetclinic.breed", "Breed"),

"labels_ids": fields.many2many("vetclinic.labels", "rel_animal_labels", "animal_id", "labels_id", string="Labels"),

"history": fields.text("History"),

"res_partner_id": fields.many2one("res.partner", "Owner"),

"image": fields.binary("Image"),

"animalvacinations_ids": fields.one2many("vetclinic.animalvacinations", "animal_id", string = "Vacinations"),

}

class vetclinic_animal_vacinations(osv.Model):

_name = "vetclinic.animalvacinations"

_columns = {

"product_id": fields.many2one("product.product", "Vacination"),

"duedate": fields.date("Due Date"),

"dateperformed": fields.date("Date Performed"),

"animal_id" : fields.many2one("vetclinic.animal", "Animal"),

}


Code for view:


<record id="vetclinic_animalvacinations_calendar_view" model = "ir.ui.view" >

<field name = "name">vetclinic.animalvacinations.calendar.view</field>

<field name = "view_type">calendar</field>

<field name = "model">vetclinic.animalvacinations</field>

<field name = "arch" type = "xml">

<calendar string = "Animal Vacinations" date_start = "duedate">

<field name = "animal_id" />

<field name = "product_id" />

</calendar>

</field>

</record>



What is missing here?

Ảnh đại diện
Huỷ bỏ
Tác giả

Used standard code from Odoo Essential book and it works fine now

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 17
4345
2
thg 1 16
10065
1
thg 7 25
457
2
thg 6 25
832
1
thg 5 25
2415