Billing Entity Management #66
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: servala/servala-portal#66
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "54-billing-entity-management"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PR for #54
cdd8838b3d
to4b3ddec4bb
3e6c598c96
toc7d079e9bf
WIP: Billing Entity Managementto Billing Entity Managementb36c0233db
todae5e7153b
@ -0,0 +130,4 @@
email = user if isinstance(user, str) else user.email
odoo_users = CLIENT.search_read(
model="res.users",
domain=[("login", "=", email)],
Enhance the domain to include
('active','=',True)
to make sure the user is active in Odoo.@ -0,0 +135,4 @@
limit=1,
)
if odoo_users and (uid := odoo_users[0].get("id")):
or_conditions.append(("create_uid", "=", uid))
A user in the Servala Portal which matches an internal user in Odoo should be able to see all invoice addresses, like they do when they log in to the Odoo backend. I figured out that the "Internal Users" filter in Odoo uses the domain
('share', '=', False)
(L342) so let's use the same to decide if the user can see all invoice addresses. There are also "Portal Users" in Odoo, they should not see all invoice addresses and behave like a normal Servala Portal user.@ -11,0 +61,4 @@
if self.odoo_addresses:
address_choices = [("", _("---------"))]
for addr in self.odoo_addresses:
display_parts = [
We should also display the
parent_id.name
field to make these addresses more discoverable to which company they belong to. And order alphabetically, if not already the case.9008833306
toadda59fe7f
@ -220,0 +223,4 @@
annotations = {
"servala.com/organization": organization.name,
"servala.com/billing": organization.origin.name,
"servala.com/origin": organization.billing_entity.name,
Billing and origin are interchanged
@ -220,0 +231,4 @@
labels[f"servala.com/erp_{field}"] = str(value)
if organization.odoo_sale_order_id:
annotations["servala.com/sales_order"] = str(
Let's make this a label as well and name the label
servala.com/erp_sale_order_id
@ -78,0 +94,4 @@
"partner_invoice_id": instance.billing_entity.odoo_invoice_id,
"state": "sale",
"client_order_ref": f"Servala (Organization: {instance.name})",
"note": "auto-generated by Servala Portal",
The field in Odoo is called
internal_note
The file
src/saleorder_storage.go
is probably not needed