Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
9185 Widoki

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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!

Awatar
Odrzuć
Najlepsza odpowiedź

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
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
kwi 20
9341
1
lip 23
2064
2
lis 24
1187
1
gru 19
5154
1
cze 18
5348