Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
11553 มุมมอง

Hi, I'm trying to add a table in the custumer model in the notebook area , something like this 


Product
Yes/No (Checkbox)
Description ()
(Here I need the list of products)



I can add more pages in the notebook area, add each of the fields separately, using devoloper mode, adding the field's in the model (res.partner), using the relation of objects, and  editing the form view with xml language, but i want a table and in the table add  rows, like a order line in the quotation model.



Odoo V10

Using developer mode, and I want to do it using this.

อวตาร
ละทิ้ง

Thank you very much for your answer, when you give an example of class, tourbooking and tourprogrammed , where I can add this class? 

คำตอบที่ดีที่สุด

Hi Mario,

You have to code a custom module for it, that will  be better. By activating the developer mode you just can manipulate the view only by clicking the edit form view .  You can define the new fields from the following,

Settings -> Technical -> Database structure -> Models,

here you can add new fields in the corresponding model and also you can create a new model.

So to create a notebook and to have a tree view like this, you have to create a one2many relation field in the res.partner model and have to define the new model. I will add attach a sample code, hope it can give you an idea.

Thank You

<page string="Tour Programme">
<field name="connect_tour_programme">
<tree editable="bottom">
<field name="no_of_days"/>
<field name="tour_description"/>
<field name="tour_breakfast"/>
<field name="tour_lunch"/>
<field name="tour_dinner"/>
</tree>
</field>

</page>
class TourBooking(models.Model):
_name = 'tour.booking'
_inherit = ['mail.thread', 'ir.needaction_mixin']

connect_tour_programme = fields.One2many('tour.programme.new', 'tour_programme_connect', string='Tour Programme')
class TourProgrammeNew(models.Model):
_name = 'tour.programme.new'

tour_programme_connect = fields.Many2one('tour.booking', string="Connect")
no_of_days = fields.Char(string='Days')
tour_description = fields.Text(string='Description')
tour_breakfast = fields.Boolean(string='Break Fast')
อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thank you very much for your answer, when you give an example of class, tourbooking and tourprogrammed , where I can add this class? 

อวตาร
ละทิ้ง

Hi, here tour booking refers to res.partner in your case. The model tour.programme.new refers to new model that has to be added

ผู้เขียน

Perfect, I solve it , thank you very much. :)

Do you have an idea have to show a image, I upload by a field type "binare", but I can show it

ผู้เขียน

Sorry about many questions, I show the fields, but when I press the button "save" the data i filled disappears. Do you have any idea?

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 18
6990
1
ม.ค. 18
4096
1
มี.ค. 17
5271
0
ธ.ค. 24
1445
Import Data From Another Model แก้ไขแล้ว
1
มี.ค. 24
2482