跳至內容
選單
此問題已被標幟
2 回覆
9242 瀏覽次數

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

頭像
捨棄
作者 最佳答案

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!

頭像
捨棄
最佳答案

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
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
4月 20
9426
1
7月 23
2095
2
11月 24
1247
1
12月 19
5193
1
6月 18
5425