Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
2407 Näkymät

in Sales -> Quotation - New we can see a Master-Detail form view which contains Order Lines tab below where user can input item-wise Details, here is a requirement each item can contain more underlying data related to each item and we want to add this functionality in View to get user input after each Order Line (Item). if Order Line have 3 items then all 3 items should have own underlying data which should be related to each Line (item). --in oracle we say it master-detail-detail like: country->state->city--

is it possible in Odoo using BUG ICON on top in Developer mode? if yes how to?

i have to create a separate table OR i can add those fields in sale.order.line ? 

please help, guide or provide a link to the guide.

regards


Avatar
Hylkää
Paras vastaus

Hello SmithJohn45,


We can't add child lines to sale order lines. We can add this extra fields to sale.order.line model or we can also create a new model. It's totally depends on your requirement. It's possible in both ways. 


We've achieve a similar functionality in past. In which, we've' added a new button to each sale order lines. This button will pop-up an form view where a user can add the extra details. We can also make system to automatically add and update the note under each sale order line to display the values configured in the extra details form. We're providing you a screenshot for better understanding. Kindly let us know if have any further questions.

I hope this will help you.
Thanks & Regards,
Email:    odoo@aktivsoftware.com     

Skype: kalpeshmaheshwari

Avatar
Hylkää
Tekijä

thank you @Jainesh, for what you have achieve i asked for here but topic closed by me because i was unable to make a relationship with the model in popup window (form view) and nobody Answer to that topic. after reading your Answer now i thought it can be done but still as of my knowledge level i am not able to achieve what you had, if there is an example link i will be much grateful as this is very important for me. ( i am from Oracle and there is no problem creating Child of a Child in very old Oracle Forms and currently in Oracle Apex, Oracle ADF etc. you just have to have PK & FK relationship ).
thanks again.
regards

Tekijä

to clear any confusion because of what i wrote, here is may be, more clearer
- i failed to create relationship with popup form view where i want an editable tree view as Child of Order Line.

regards

Hello @SmithJohn45,
It we'll not possible to develop this requirement from UI side. But here is the mind-map to achieve this.

1: Create a new model. In this example we'll named is 'specification.sheet'.
2: Now we need to link this model with 'sale.order.line' and to achieve this we'll extend the 'sale.order.line' model and add Many2one field named specification_sheet_id. But we also need to link the 'sale.order.line' to 'specification.sheet'. So, we'll add new Many2one field named sale_line_id.
3: Now, add a object type button in sale order line. Once we add a button in xml file we need to write the logic for this button which is as follow.

def action_open_specification_sheet(self):
"""
Used to open specification sheet pop-up.

Note:
1: If the sale line has specification_sheet_id field populated then we'll open the same record in pop-up window by using 'res_id' in action.
2: When we're using this button for newly created sale order line, We'll not have specification_sheet_id field populated. So in this case system will create a new record of 'specification.sheet' and we need to set default value of sale_line_id field for this record with the help of 'context' in action.
"""
self.ensure_one()
return {
'name': _('Specification Sheet'),
'view_mode': 'form',
'res_model': 'specification.sheet',
'res_id': self.specification_sheet_id.id,
'view_id': False,
'type': 'ir.actions.act_window',
'context': {
'default_sale_line_id': self.id,
},
'target': 'new'
}
4: After adding a button in view, We'll define a action confirm of the specification sheet's pop-up window. In which, we need to do two things.

A: We need to set specification_sheet_id field of sale order line (We can use sale_line_id field to identify the sale line).
B: We'll prepare a string which contains all the impotent information and create a note in 'sale.order.line'. We also need to link this line with 'specification.sheet'. So, in future we can easily modify the value of this line. To achieve this we can add a new field named custom_sol_note_id in 'specification.sheet'.

Feel free to reach out to us if you have any further questions.

Tekijä

huge thanks @Jainesh for very detailed explaination and guidance, will check what i can achieve from it. i really impressed with your deep concern to help us.

kind regards

Paras vastaus

Each line that you create in an order is saved in the database in the model 'sale.order.line' you can create its own view and add more details by creating more fields in the model.

Avatar
Hylkää
Tekijä

thanks, but what i asked is another question. is it possible, if yes, how to?

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
3
elok. 25
2321
1
toukok. 25
2545
1
huhtik. 25
3515
1
huhtik. 25
4344
1
huhtik. 25
1820