This question has been flagged
2 Replies
3824 Views

So... i need to make a table like the one below and place it in the sales quote.

If this feasible? The fields are not related to any other fields.

I just need to add this table and print it with the sales quote.

Basically, i need to add an ' extra'services spreadsheet to the sales quote. Since all the values in the spreadsheet are variable, i found no other way to do it, instead of creating dozens of new products everytime, which wouldn't work.

I'd be using hundreds, if not thousands of different places and prices.

Any ideas in how i can achieve this?


Place
Visit
Freight
Instalation
NY
75
180
55
LA
65
99
75
Miami
130
60
77
Lisbon
450
65
670
Rio
43
45
32
Avatar
Discard
Best Answer

It's definitely possible to do this with a minor customization. I'll write a detailed reply a little later, if possible or over the weekend. Hope that's ok.


EDIT:

The data in Odoo is managed using models which map to the underlying tables in the database. You can also define relationships between the models. A form (screen) in Odoo is a view that is based on a model.

In your case, since you want to capture the "spreadsheet" data in the Quotation/Sales Order, you will need to do the following customizations to make it available within Odoo. I'm assuming you are using Studio since you had mentioned it in the title of your previous post.

  1. Go to Settings, scroll all the way to the bottom and click on Activate Developer Mode

  2. Go to Settings > Technical Settings > Database Structure > Models and create a new model (for example, x_quotation_spreadsheet) to capture the "spreadsheet" data. Edit the model and add custom fields with the appropriate field types for Place (use x_name for this), Visit, Freight, Installation and a many2one field for Sales Order ID. Note that Odoo will automatically add some additional standard audit trail fields when you create a new model - you should not touch these fields. 

  3. Grant access rights on the x_quotation_spreadsheet model to the Sales / User: Own Documents Only security group. 

  4. Edit the Sales Order model (sale.order) and add a one2many custom field (for example, x_quotation_spreadsheet_ids) that links to the x_spreadsheet model. 

  5. Go to Sales, open one of the Quotations, and activate Studio to customize the Quotation/Sales Order view. Click on the + sign in the tabs to add a new tab. Specify the name of the tab in the properties on the left. 

  6. Click on + Add in the properties pane on the left and scroll down to the Existing Fields section. Click and drag the Spreadsheet Data (x_spreadsheet_ids) field into the tab. Click on the field and select the EDIT LIST VIEW option that pops up and add the fields listed in the Existing Fields section to the list view.

  7. Similarly, you can customize the form view of the spreadsheet data field by using EDIT FORM VIEW. Remember to make the Sales Order ID field invisible in the form view. It will be managed by Odoo automatically and will contain the id of the Sales Order associated with the data.

  8. Save the changes.

  9. Open one of the existing Quotations. You will see the new tab and be able to add the data in Edit mode. 

There is some more customization that can be done outside of Studio using view inheritance to make the field occupy the full width of the tab and provide inline editing instead of using the form view to enter the data for each line. It looks like Studio does not expose the properties needed to do this for now.

Hope this helps.


Avatar
Discard
Author

That would be perfect.

I really apreciate it! Thanks!

I have edited the original post and added the details

Author

I can't believe it! Thank you so much!

It worked! Yes, there are some customization to make, but for now, it will serve me perfectly.

Thanks Paresh! You saved my week. :)

Hi I have followed the steps and added a spreadsheet in a task in project.

I now wanted to produce a report from it but since it is from another model I do not get to select all the fields in Odoo studio when building a report. Any solution?

Thanks

@Feryial: The contents of the one2many field should be accessible while building the report by expanding the field and selecting the fields within it.