Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
6917 Visualizzazioni

Hi,

When I create a sales order, we have set it up to produce a manufacturing order automatically using some products with a bill of materials.

I am trying to display the customer name on our kanban view on our manufacturing pages, however I can not find a way to parse the partner_id value from sales.order to the manufacturing page.

There is a default "origin" field set up with a reference to the Sales order id number, however this is not a hyperlink - just text.

If anyone could offer support that would be fantastic.

Avatar
Abbandona
Risposta migliore

Take a look at this v11 module: https://apps.odoo.com/apps/modules/11.0/mrp_sale_info/

Let me know if you need it for v12, which i can provide for you.

Avatar
Abbandona
Autore

Hi, we looked at this before but it was only a v11 module. It would be perfect for what we are looking for! If you could provide v12 that would be fantastic!

Hi Ray. If you share here your github username, i will give you access to the module. The module is provided "As is". Please provide your feedback on the module to me afterwards, as we have only had little testing.

This module can't set the sale_order_id if there is any reordering rule on the product because the procurement_group_id.sale_id is empty when this is the scenario. Can you guide me about this scenario.

Risposta migliore

in Odoo 12 there is a method called 

def _run_manufacture(self, product_id, product_qty, product_uom, location_id, name, origin, values): 

defined in mrp module stock.rules.py file.

override this method , in the values parameter, you will be able to find a fileld called 'sale_line_id' this is the sale line from which this MO came from  (this value wont be present if it is not created from a sale order eg: orderpoint created MO)

declare a field in mrp.production with name sale_partner_id and update the values in this method with {'partner_id': sale_line_id.order_id.partner_id.id}

this would solve your problem


Avatar
Abbandona
Autore

Hi, thank you for your response. I am having trouble following your instructions - I have added "sale_line_id" to the argument list for the _run_manufacture method ( def _run_manufacture(......,values, sale_line_id). I have done "settings -> technical -> models -> mrp.production -> add a line' and added "partner_id" as a custom field.I am not sure where I can "update the values in this method". Could you explain further please? Kind regards

If any there is a defined re-ordering rule for the product _run_manufacture is being called with orderpoint instead of sale.order so in the values there is only "orderpoint_id". I need to find the reference between an orderpoint and sale order which i could not find.

Post correlati Risposte Visualizzazioni Attività
1
lug 18
10685
2
ago 24
1439
4
ott 21
10744
0
lug 16
4095
1
mag 15
4823