Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
9138 Vistas

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
Descartar
Autor Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
abr 20
9325
1
jul 23
2024
2
nov 24
1170
1
dic 19
5133
1
jun 18
5290