Thursday, March 20, 2025
1 change · saas-17.4
Resolved issues and error corrections
This fix prevents users from accidentally creating incomplete sales order lines through quick-create fields. When the quick create cannot provide the required product details, Odoo now opens the full form so the missing information can be entered properly, improving data quality in sales and project workflows.
Original PR description
Steps to reproduce: - In any of the SOL Many2one field with create=True. - Create a SOL using create option in dropdown. Issue: - A SOL is created without product. Reason: - Incorrect SQL constraint…
Steps to reproduce: - In any of the SOL Many2one field with create=True. - Create a SOL using create option in dropdown. Issue: - A SOL is created without product. Reason: - Incorrect SQL constraint passed . Fix: - Adding a validation error which is tapped in if Many2one quick create i.e., Create option fails and opens the Many2X form. - We cant change the SQL contraint because it is only applied when module is intalled/updated/reinstalled. --- Why the SQL contsraint fails "CHECK(display_type IS NOT NULL OR is_downpayment OR (product_id IS NOT NULL AND product_uom IS NOT NULL))" Also is_downpayment doesnt have a default value. Here consider we dont event send a single value all as nulls then result would be CHECK(NULL IS NOT NULL OR NULL OR (NULL IS NOT NULL AND NULL IS NOT NULL)) CHECK(FALSE OR NULL OR (FALSE AND FALSE) CHECK(FALSE OR NULL OR FALSE) CHECK(NULL) SQL doesn't categorize NULL into truthy or falsy value. For example a SQL constraint as CHECK (row1 NOT NULL OR row2 ...(and N number of conditions)) -- will always pass the check (even if you pass all the rows as NULL) NULL OR NULL -- TRUE (passes the empty NULL column value as [null]) FALSE OR NULL -- TRUE (passes the empty NULL column value as [null]) TRUE OR NULL -- TRUE It there is another column which has value it glady create a row with values and [null]/empty value for others. task-4441043 Co-Authored By - @xavierbol