diff --git a/frepple/controllers/inbound.py b/frepple/controllers/inbound.py index b05887d1..3c439853 100644 --- a/frepple/controllers/inbound.py +++ b/frepple/controllers/inbound.py @@ -551,11 +551,15 @@ def run(self): "origin": "frePPLe", } ) + # Remember odoo name for the MO reference passed by frepple. + # This mapping is later used when importing WO. mo_references[elem.get("reference")] = mo - mo._onchange_product_qty() mo._onchange_workorder_ids() mo._onchange_move_raw() mo._create_update_move_finished() + # mo.action_confirm() # confirm MO + # mo._plan_workorders() # plan MO + # mo.action_assign() # reserve material else: # MO update mo = mfg_order.with_context(context).search( @@ -580,7 +584,6 @@ def run(self): ) mo_references[elem.get("reference")] = mo - # Process the workorder information we received if wo_data: for wo in mo.workorder_ids: diff --git a/frepple/controllers/outbound.py b/frepple/controllers/outbound.py index 6830ee04..2fc1d9a9 100644 --- a/frepple/controllers/outbound.py +++ b/frepple/controllers/outbound.py @@ -1138,7 +1138,10 @@ def export_items(self): ) suppliers = {} for sup in results: - name = self.map_customers.get(sup["partner_id"][0]) + name = self.map_customers.get(sup["partner_id"][0], None) + if not name: + # Skip uninterested suppliers (eg archived ones) + continue if sup.get("is_subcontractor", False): if not hasattr(tmpl, "subcontractors"): tmpl["subcontractors"] = []