Technical 보관된 메일 그룹

technical@mail.odoo.com

Avatar

Re: Purchases

작성자
Alain Van Utterbeeck
- 2019년 07월 03일 02시 56분 52초
I believe you are talking about manufacturing orders:  take a look at the available modules in github.com/OCA/manufacture/tree/11.0, I'm pretty sure you'll find what you are looking for.
Greetings,
Alain

On Tue, Jul 2, 2019 at 4:56 PM Dominic Pain <dominic@flowmo.co> wrote:

Hi,

Have a look at sale_order.action_confirm(). I think that's where you need to be putting your custom code. Something like this:

                                                                                                                                                                                                
@api.multi                                                                                                                                                                                      
def action_confirm(self):                                                                                                                                                                       
    projects = self.env['project.project'].search([('sale_order', '=', self.id)])                                                                                                               

## do custom stuff...

## then return control back to odoo

                                                                                                                                                                                                
    return super(SaleOrder,                                                                                                                                                                     
        self.with_context({'mail_create_nosubscribe': True})).action_confirm()                  

## and override the existing action_confirm with your new definition                                                                                               
SaleOrder.action_confirm = action_confirm

You've mentioned action_confirm - maybe you're missing the SaleOrder.action_confirm = action_confirm step?


Oh - there's also this,

for line in order: ## <-- this isn't correct, I'm summarising
       line_product_id = product_id.id                                                                                                                                                         
        line_product_name = product_id.product_tmpl_id.name                                                                                                                                     
        line_order_id = int(order_id)                                                                                                                                                           
        line_uom = product_id.uom_id.id                                                                                                                                                         
        new_line = line_env.create({                                                                                                                                                            
            'product_id': line_product_id,                                                                                                                                                      
            'name': line_product_name,                                                                                                                                                          
            'order_id': line_order_id,                                                                                                                                                          
            'product_uom' : line_uom})                                                                                                                                                          
        new_line.product_id_change() #Calling an onchange method to update the record                                                                                                           
        new_line.product_uom_change()                                                                                                                                                           
        new_line._compute_invoice_status()                                                                                                                                                      
        new_line._compute_amount()                                                                                                                                                              
        new_line._get_to_invoice_qty()                                                                                                                                                          
        new_line._get_price_reduce()

You need to do all that stuff (in odoo 10) to process adding a product to a SO successfully, too Not sure about odoo 12/11, but hopefully it's useful.


Good luck

Dom

On 02/07/2019 15:29, Guido Schaidl wrote:
Hi Dom,

i have written an application that has orders with products on it. As soon as the order is confirmed products in the order should be purchased from a supplier.

Exactly like the sales app does it. Quotation is confirmed. You have a request for Quotation instanly with the products of the Quotation/Order with the attribute "make to order".

I don't know how to do this and where i can find the code for this. I can't find  it in the sales app or purchase app.
In the sale app it should be in action_confirm(_action confirm, action_done). It's not.

There is an scheduled Action called Procurement, but it runs daily. The creation of the request for quotation is done instantly.



On 02.07.19 15:59, Dominic Pain wrote:

HI, Guido,

Not too sure what you mean - but I've worked on an api which does an rpc call to create SO's "automatically". The API itself is php, but does a xml-rpc call to the sale_order.create method. This is using odoo 10.

I'm now working my way towards odoo 12, and there's definitely a "Scheduled Action" facility there. I can't *imagine* that Belgium removed that for odoo 11 and then replaced it in 12?

Can you provide more info?

Thanks

Dom

On 02/07/2019 14:45, Guido Schaidl wrote:
Hello,

i want to add automated ordering of products to my application. Pretty 
much like it's done in the sales app.

I want to genearate a Request for every product in a confirmed status 
with "make to order" attribute.


I older versions there was a sheduler. That's not there anymore.


How does it works in version 11? Can someone point me to the 
model/application that does it? Is there some documentation?


Regards Guido

_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/technical-62
Post to: mailto:technical@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe



--
Alain Van Utterbeeck

ODOO Developer


 

DR Gaming Technology Europe nv/sa


–––––––––––––––––––––––––––––––––


DISCLAIMER


This e-mail is from DR Gaming Technology nv/sa located in Belgium (BE).The messages you send and/or receive are transmitted via the Internet. It is therefore impossible for us to guarantee the confidentiality, accuracy and completeness of data and/or documents that are sent by electronic mail and we accept no liability for consequences and/or damage whatsoever related to data and/or documents which are thus communicated. The information in this e-mail is confidential and intended solely for the person to whom it is addressed. If this message is not addressed to you, please be aware that you have no authorisation to read the content of this e-mail, to copy it or to furnish it to any person other than the addressee or take any action in reliance on it. Should you have received this e-mail by mistake, please bring this immediately to the attention of the sender, after which you are kindly requested to destroy the message and not to disclose or disperse its content. Only when this message is supported by lawfully signed documents can any rights be derived from the content of this message with regard to DR Gaming Technology nv/sa.

참조

  • Avatar

    Purchases

    작성자
    guidoscha
    - 2019년 07월 02일 09시 42분 24초 - 0

    9 답글 9 답글