Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1698 Weergaven

I have set an Automated Acton to execute the following python to falg an error when certain fields aren;t completed when the order is being confirmed.  

The issue is not that for some reason it also now flags the error when an invoice is being created or a new customer is being created (Even though the fields are filled in and even though it should only be applicable to the sales module)

Can anyone assist?


---
missing_fields = []


if not record.x_studio_delivery_date:

missing_fields.append("Delivery Date (The date the customer gets on their paperwork)")


if not record.x_studio_date_for_supplier:

missing_fields.append("Date For Supplier (Date for ops To ask supplier to achieve)")


if not record.client_order_ref:

missing_fields.append("Purchase Order (To ensure fast payment of invoices)") 


if not record.x_studio_field_FgkKF:

missing_fields.append("Approved Supplier (If not an existing approved supplier, please follow onboarding process)") 


if record.state == 'sale' and missing_fields:

error_msg = "Please fill in the following fields before confirming the order:\n\n"

error_msg += "- " + "\n- ".join(missing_fields)

raise UserError(error_msg)

-------------------


Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
2
mrt. 24
7032
3
jun. 25
2378
0
mei 24
1610
1
mrt. 24
1493
1
jan. 24
1454