diff --git a/CHANGELOG b/CHANGELOG
index f7ea954a93..4ae6fde269 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,4 @@
+* Allow to create customer with ID
* Allow to create manual payment
* Add capture
diff --git a/payment.py b/payment.py
index 9a86dd6a7a..93a6259643 100644
--- a/payment.py
+++ b/payment.py
@@ -364,7 +364,13 @@ class Customer(ModelSQL, ModelView):
stripe_checkout_needed = fields.Function(
fields.Boolean("Stripe Checkout Needed"), 'get_stripe_checkout_needed')
stripe_checkout_id = fields.Char("Stripe Checkout ID", readonly=True)
- stripe_customer_id = fields.Char("Stripe Customer ID", readonly=True)
+ stripe_customer_id = fields.Char(
+ "Stripe Customer ID",
+ states={
+ 'readonly': ((Eval('stripe_customer_id') | Eval('stripe_token'))
+ & (Eval('id', -1) >= 0)),
+ },
+ depends=['stripe_token'])
stripe_token = fields.Char("Stripe Token", readonly=True)
stripe_error_message = fields.Char("Stripe Error Message", readonly=True,
states={
@@ -394,7 +400,7 @@ class Customer(ModelSQL, ModelView):
return True
def get_stripe_checkout_needed(self, name):
- return not self.stripe_token
+ return not self.stripe_customer_id and not self.stripe_token
def get_rec_name(self, name):
name = super(Customer, self).get_rec_name(name)
diff --git a/view/customer_form.xml b/view/customer_form.xml
index 0c97042a54..cc9b35d66a 100644
--- a/view/customer_form.xml
+++ b/view/customer_form.xml
@@ -9,8 +9,8 @@ this repository contains the full copyright notices and license terms. -->
-
-
+
+
diff --git a/view/customer_list.xml b/view/customer_list.xml
index 5697c737d0..ce768b9b8f 100644
--- a/view/customer_list.xml
+++ b/view/customer_list.xml
@@ -3,8 +3,8 @@
this repository contains the full copyright notices and license terms. -->
-
+