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

Hello,


How can i custom the workflow of the sale module ? 

I just need to add an intermediate stage.


I assume i need to create a custom module


Thank you

Ảnh đại diện
Huỷ bỏ

Hi Hoang

Probably yes or it depend on your use case

Example:

you need just a stage that is before "sale" means before creating the stock.moves, and you can change the stage manually than this can be done also with odoo studio if you have enterprise


If you need a logik behide like, when conforming the sale orde, it should check something and put to stage "custome" intead of sale, then yes you need a custom module as you have to extend the confirm method of odoo, add a new selection to the field state and create you logik method


Warm regards

Daniel

Câu trả lời hay nhất

Hi Hoang


then create a custom module


class SaleOrder(models.Model):
_inherit = 'sale.order'

​state = fields.Selection(selection_add=[('waiting', 'Waiting Payment'), ('sale',)])

​def action_confirm(self):
for order in self:
is_immediate_payment = self.your_method_to_check_payment() # should return True or False
if not is_immediate_payment:
return super(SaleOrder, self).action_confirm()

return order.write({
'state': 'waiting'
})


Hope this helps

Daniel

Ảnh đại diện
Huỷ bỏ
Tác giả

Hello,

Thank you for your reply.
I will test this asap,

Thank you very much

Câu trả lời hay nhất

You can search "wkf_powerful" in  odoo app store. this is a good app for   workflow !

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

Hello, 

Thank for your reply. 

Yes i need a stage before the stock.moves.

but precisely, I dont want to create a stock.moves before check the payment term. 

Example : 

If payment terms == immediate 

​state = waiting payment

else 

​state = sale

​create draft invoice


I don't know if this feature is already implemented in standard. 

and yes i have enterprise. 


Best regards

Ảnh đại diện
Huỷ bỏ

Hi Hoang
I updated my answer, can you check?
Daniel

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 10 24
1811
3
thg 2 25
1974
1
thg 12 24
2101
2
thg 3 24
2444
2
thg 3 24
2976