Organizations and Sale Orders in Odoo #55
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: servala/servala-portal#55
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Stories
As a system, I want to manage Sale Orders in Odoo regarding organizations
An organization in Servala is represented as a Sale Order in Odoo (model
sale.order
).Implementation Notes
When creating an organization, we also need to create a Sale Order in Odoo and set the
partner_id
andpartner_invoice_id
to the values from the billing entity (see #54).Store the
id
andname
of the created Sale Order record in the organization so that we can reference it accordingly.Sales Order are in the
sale.order
model of Odoo. The following fields must be set when creating a record:partner_id
=Organization.billing_entity.odoo_company_id
partner_invoice_id
=Organization.billing_entity.odoo_invoice_id
state
= "sale"client_order_ref
= f"Servala (Organization: ${Organization.name})"internal_note
= "auto-generated by Servala Portal"See also https://github.com/appuio/control-api/blob/master/controllers/saleorder/saleorder_storage.go#L53