Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7898 Lượt xem

I need to change the order line notes/comments even after the sale order is confirmed. I cannot figure out where is the read-only attribute controled by the view or sale_order_line module.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

It is defined in file sale/sale.py:

'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)]}),

The whole sale.order.line is only writable if the order is in state draft. Here is one suggestion to get your intended functionality:

  1. Remove attributes readonly and states from order_line in sale/sale.py
  2. Add attribute attrs={'readonly': [(parent.state,'!=','draft')]} to all fields of the sale.order.line in view sale.order.form.
Ảnh đại diện
Huỷ bỏ

But I think its would be not a good practice coz there comes a corresponding entries in customer invoice and when when we change(Edit) S.O Lines then it will not reflect further in accounting, it will show only previous one ...

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 12 24
21290
0
thg 9 24
1101
3
thg 8 24
2239
0
thg 2 24
1526
0
thg 2 24
1113