Allow to create customer with ID

issue6685
review39581002
This commit is contained in:
Cédric Krier committed 2017-08-04 00:35:11 +02:00
1 parent 6be3778dc9
commit 66fc3d379a
4 files changed
+12 -5

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Allow to create customer with ID
* Allow to create manual payment
* Add capture
+8 -2
View File
@@ -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)
+2 -2
View File
@@ -9,8 +9,8 @@ this repository contains the full copyright notices and license terms. -->
<label name="stripe_account"/>
<field name="stripe_account"/>
<newline/>
<label name="stripe_token"/>
<field name="stripe_token"/>
<label name="stripe_customer_id"/>
<field name="stripe_customer_id"/>
<button string="Stripe Checkout" name="stripe_checkout" colspan="2"/>
<field name="stripe_checkout_needed" colspan="4" invisible="1"/>
<label name="stripe_error_message"/>
+1 -1
View File
@@ -3,8 +3,8 @@
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="party"/>
<field name="stripe_token"/>
<field name="stripe_account"/>
<field name="stripe_customer_id"/>
<button string="Stripe Checkout" name="stripe_checkout"/>
<field name="stripe_checkout_needed" tree_invisible="1"/>
<field name="active" tree_invisible="1"/>