Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
10549 Zobrazení

Hi everyone

I try to create Sale Oder in module Sale directly when I click "Save" button in create Quotation form, it means I skip creating Quotation step when I click it. My system doesn't need "comfirm sale" button, because it creates a sale order directly, and I can hide this button.

I try changing "state" value in default from "draft" to "manual" in sale.py, but it doesn't work. So, How do I do it?

Help me, please

Thank you.

Avatar
Zrušit
Nejlepší odpověď

You will have to modify sale_order function for create to call the workflow:

wf_service.trg_validate(uid, 'sale.order', ids[0], 'order_confirm', cr)

That way creating a new quotation will automatically go through workflow and create a sale order.

Avatar
Zrušit
Autor Nejlepší odpověď

Hi Mariusz Mizgier
I know your code, It same in function "action button confirm" and it set confirm for the quotation. But "sale_order" is a class, I cant found a function with name "sale_order" or I dont know which function create a quotation to add your code here.

And I will create a module to inherit "sale" module, so, How do I modify that function to create sale order directly

Please explain more for me, please!!!

Thank you so much!

Avatar
Zrušit

I've created a small module for you - check it out at https://drive.google.com/file/d/0B_0MqUxRHKNjVUdGdkRjdEFJbVk/edit?usp=sharing This overrides default create method then auto-confirms quotation to make it sale order. You can make some tweaks to hide buttons in form view.

Hi Mariusz Mizgier

received you module and it worked. Thank you so much, you are very kind.
Thank you again! 

2014-08-01 17:16 GMT+07:00 Mariusz Mizgier <mariusz.mizgier@currenda.pl>:

I've created a small module for you - check it out at https://drive.google.com/file/d/0B_0MqUxRHKNjVUdGdkRjdEFJbVk/edit?usp=sharing This overrides default create method then auto-confirms quotation to make it sale order. You can make some tweaks to hide buttons in form view.

--
Mariusz Mizgier Sent by OpenERP S.A. using Odoo. Access your messages and documents in Odoo



--
Trần Như Văn
MSSV: 51104177
K11 Bách Khoa Tp.HCM
Khoa: Khoa học và Kĩ thuật máy tính

That's great to hear, if you can be so kind and mark the question as solved that would be great ;)

Hi Mariusz Mizgier

I have a little problem. That is modifying a function, which return default value of a column. I'm very glad if you help me, please!
I wrote "super(<my_class>, self).<my_function>(cr, uid, context)" in the function content, but it didn't override the function I want. So, when I run openERP, in module "Warehouse" and create a "Incoming Products", the Location have been changed value default as i override, but after that, it return old default value

Thank you so much.

--
Trần Như Văn
MSSV: 51104177
K11 Bách Khoa Tp.HCM
Khoa: Khoa học và Kĩ thuật máy tính
Related Posts Odpovědi Zobrazení Aktivita
0
říj 24
1007
0
bře 15
4582
0
dub 24
1421
2
pro 15
4411
1
pro 15
3848