Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

[Solved] Create Sale Oder when click button "Save" - skip Quotation

By
NhuVanTran
on 8/1/14, 5:30 AM 2,552 views

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.

2
Mariusz Mizgier
On 8/1/14, 5:37 AM

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.

0
NhuVanTran
On 8/1/14, 5:54 AM

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!

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.

Currenda Sp. z o.o., Mariusz Mizgier
on 8/1/14, 6:16 AM
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
NhuVanTran
on 8/1/14, 6:23 AM

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

Currenda Sp. z o.o., Mariusz Mizgier
on 8/1/14, 6:31 AM
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
NhuVanTran
on 8/7/14, 12:01 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/1/14, 5:30 AM
Seen: 2552 times
Last updated: 3/16/15, 8:10 AM