diff --git a/lib/recycledcloud/billing/partner.ex b/lib/recycledcloud/billing/partner.ex index 2f79634..e084f1e 100644 --- a/lib/recycledcloud/billing/partner.ex +++ b/lib/recycledcloud/billing/partner.ex @@ -7,13 +7,14 @@ defmodule RecycledCloud.Billing.Partner do import Ecto.Changeset use Ecto.Schema - @address_fields [:street, :city, :zip] + @address_fields [:display_name, :street, :city, :zip] # Note: Odoo stores partner's country under 'country_id'. We do not support # editing it at the moment. embedded_schema do field :name, :string + field :display_name, :string field :email, :string field :street, :string field :city, :string @@ -47,11 +48,12 @@ defmodule RecycledCloud.Billing.Partner do end def get(id) do + fields = ["id", "name", "email", "country_id", "display_name"] ++ @address_fields result = Odoo.query([ "res.partner", "search_read", [[["id", "=", id]]], - %{"fields" => ["id", "name", "email", "country_id"] ++ @address_fields} + %{"fields" => fields} ]) format_fields = fn p -> diff --git a/lib/recycledcloud_web/templates/billing/index.html.eex b/lib/recycledcloud_web/templates/billing/index.html.eex index 1a46885..8fd9e9c 100644 --- a/lib/recycledcloud_web/templates/billing/index.html.eex +++ b/lib/recycledcloud_web/templates/billing/index.html.eex @@ -11,6 +11,11 @@ <% end %> + <%= text_input f, :display_name, placeholder: "Display name" %> + <%= error_tag f, :display_name %> + +
+ <%= text_input f, :street, placeholder: "Street" %> <%= error_tag f, :street %>