refactor odoo company type handling #143

Merged
tobru merged 1 commit from odoo-company-check into main 2025-07-07 12:11:30 +00:00
Owner

This solves this error seen in the Odoo log:

[pod/odoo-595dcc8665-lrd8m/web] 2025-07-03 14:27:20,887 67 ERROR VSHNPreProd odoo.osv.expression: Non-stored field res.partner.company_type cannot be searched.
[pod/odoo-595dcc8665-lrd8m/web] NoneType: None

In Odoo, is_company is the stored boolean field that determines if a partner is a company (True) or an individual/contact (False), while company_type is a computed field that returns "company" or "person" based on the is_company value.

This solves this error seen in the Odoo log: ``` [pod/odoo-595dcc8665-lrd8m/web] 2025-07-03 14:27:20,887 67 ERROR VSHNPreProd odoo.osv.expression: Non-stored field res.partner.company_type cannot be searched. [pod/odoo-595dcc8665-lrd8m/web] NoneType: None ``` In Odoo, `is_company` is the stored boolean field that determines if a partner is a company (True) or an individual/contact (False), while `company_type` is a computed field that returns "company" or "person" based on the `is_company` value.
tobru added 1 commit 2025-07-03 14:44:53 +00:00
refactor odoo company type handling
All checks were successful
Tests / test (push) Successful in 27s
76bc37e3f0
rixx was assigned by tobru 2025-07-03 14:45:00 +00:00
tobru added this to the Development Planning project 2025-07-07 11:13:40 +00:00
rixx approved these changes 2025-07-07 12:06:48 +00:00
rixx left a comment
Member

LGTM

LGTM
@ -120,3 +120,2 @@
def get_odoo_access_conditions(user):
# Were building our conditions in order:
# - in exceptions, users may be using a billing accounts email
# We're building our conditions in order:
Member

haha sorry, I use apostrophes by default when writing text (as opposed to code), but I suppose that does look odd in some IDEs …

haha sorry, I use apostrophes by default when writing text (as opposed to code), but I suppose that does look odd in some IDEs …
tobru marked this conversation as resolved
tobru merged commit 24cb249e9e into main 2025-07-07 12:11:30 +00:00
tobru deleted branch odoo-company-check 2025-07-07 12:11:30 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: servala/servala-portal#143
No description provided.