Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
9146 Tampilan

Hello,

I've imported a fair number of quotations into Odoo.

Now I need to change the state (status) of 1800 of them from "Quotation" to "Sales". So I wanted to export the quotations, change their state in Excel, and reimport them.

Unfortunately, the export tool doesn't let me export the field "state". And the import tool won't let me reimport the file if I manually add a column "state" filled with "sales".

I guess that's because the field is defined as read-only.

Do you have any idea of the way I could change the state of these quotations with an import ?

Tahnks and best wishes

Avatar
Buang
Penulis Jawaban Terbai

Waleed, thanks for your answer.

It sounds a little too technical for me at this time, but I'll look into it and try the method suggested.

Thanks again!

Avatar
Buang
Jawaban Terbai

Hello,

The state field is read only and you will not see it in the available fields in import screen:

state = fields.Selection([
('draft', 'Quotation'),
('sent', 'Quotation Sent'),
('sale', 'Sales Order'),
('done', 'Locked'),
('cancel', 'Cancelled'),
], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange', default='draft')

My suggestion is to create a new module and override create method to confirm each quotation as below and after install the module, try to import your quotations. (I didn't test and I believe it will work and it's worth to give it a try in Test Environment and let us know the results) 

    @api.model
def create(self, vals):
result = super(SaleOrder, self).create(vals)
result.action_confirm()
return result 

 But you already imported them and you want to confirm them all to sale, you can create a module to override write method as below and after install the module, try to import your quotations. (I didn't test and I believe it will work and it's worth to give it a try in Test Environment and let us know the results) 

   @api.multi
   def write(self, values):
result = super(SaleOrder, self).write(values)
result.action_confirm()
return result
Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Apr 20
9328
1
Jul 23
2025
2
Nov 24
1174
1
Des 19
5135
1
Jun 18
5308