mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[FIX][H4547] website_sale_signifyd: make module installable
This commit is contained in:
@@ -125,16 +125,17 @@ class SaleOrder(models.Model):
|
|||||||
'confirmationEmail': self.partner_id.email,
|
'confirmationEmail': self.partner_id.email,
|
||||||
'confirmationPhone': self.partner_id.phone,
|
'confirmationPhone': self.partner_id.phone,
|
||||||
'products': [
|
'products': [
|
||||||
'itemName': line.product_id.name,
|
{
|
||||||
'itemPrice': line.price_unit,
|
'itemName': line.product_id.name,
|
||||||
'itemQuantity': line.product_uom_qty,
|
'itemPrice': line.price_unit,
|
||||||
'itemIsDigital': line.product_id.is_digital,
|
'itemQuantity': line.product_uom_qty,
|
||||||
'itemCategory': line.product_id.categ_id.name,
|
'itemIsDigital': line.product_id.is_digital,
|
||||||
# 'itemSubCategory'?
|
'itemCategory': line.product_id.categ_id.name,
|
||||||
'itemId': line.product_id.id,
|
# 'itemSubCategory'?
|
||||||
'itemUrl': line.product_id.website_url,
|
'itemId': line.product_id.id,
|
||||||
'itemWeight': line.product_id.weight,
|
'itemUrl': line.product_id.website_url,
|
||||||
for line in self.order_line if line.product_id
|
'itemWeight': line.product_id.weight,
|
||||||
|
} for line in self.order_line if line.product_id
|
||||||
],
|
],
|
||||||
'shipments': [
|
'shipments': [
|
||||||
{
|
{
|
||||||
@@ -146,24 +147,24 @@ class SaleOrder(models.Model):
|
|||||||
},
|
},
|
||||||
'transactions': [
|
'transactions': [
|
||||||
{
|
{
|
||||||
"parentTransactionId": None,
|
'parentTransactionId': None,
|
||||||
"transactionId": tx.id,
|
'transactionId': tx.id,
|
||||||
"gateway": tx.acquirer_id.name,
|
'gateway': tx.acquirer_id.name,
|
||||||
"paymentMethod": "CREDIT_CARD",
|
'paymentMethod': 'CREDIT_CARD',
|
||||||
"gatewayStatusCode": tx_status_type.get(tx.state, 'PENDING'),
|
'gatewayStatusCode': tx_status_type.get(tx.state, 'PENDING'),
|
||||||
"currency": tx.currency_id.name,
|
'currency': tx.currency_id.name,
|
||||||
"amount": tx.amount,
|
'amount': tx.amount,
|
||||||
# "avsResponseCode": "Y",
|
# "avsResponseCode": "Y",
|
||||||
# "cvvResponseCode": "N",
|
# "cvvResponseCode": "N",
|
||||||
"checkoutPaymentDetails": {
|
'checkoutPaymentDetails': {
|
||||||
"accountHolderName": tx.partner_id.name,
|
'accountHolderName': tx.partner_id.name,
|
||||||
"billingAddress": {
|
'billingAddress': {
|
||||||
"streetAddress": tx.partner_id.street,
|
'streetAddress': tx.partner_id.street,
|
||||||
"unit": tx.partner_id.street2,
|
'unit': tx.partner_id.street2,
|
||||||
"city": tx.partner_id.city,
|
'city': tx.partner_id.city,
|
||||||
"provinceCode": tx.partner_id.state_id.code,
|
'provinceCode': tx.partner_id.state_id.code,
|
||||||
"postalCode": tx.partner_id.zip,
|
'postalCode': tx.partner_id.zip,
|
||||||
"countryCode": tx.partner_id.country_id.code,
|
'countryCode': tx.partner_id.country_id.code,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -175,7 +176,7 @@ class SaleOrder(models.Model):
|
|||||||
optional_keys = ['itemUrl', 'itemWeight']
|
optional_keys = ['itemUrl', 'itemWeight']
|
||||||
for key in optional_keys:
|
for key in optional_keys:
|
||||||
if not line[key]:
|
if not line[key]:
|
||||||
line.pop(key)
|
line.pop(key)
|
||||||
|
|
||||||
# API v2
|
# API v2
|
||||||
# new_case_vals = {
|
# new_case_vals = {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class SignifydCoverage(models.Model):
|
|||||||
name = fields.Char(required=True)
|
name = fields.Char(required=True)
|
||||||
description = fields.Char()
|
description = fields.Char()
|
||||||
code = fields.Char(required=True)
|
code = fields.Char(required=True)
|
||||||
exclusive = fields.Boolean())
|
exclusive = fields.Boolean()
|
||||||
|
|
||||||
def _apply_exclusivity(self):
|
def _apply_exclusivity(self):
|
||||||
return self.filtered('exclusive')[:1] or self
|
return self.filtered('exclusive')[:1] or self
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='website_id']" position="after">
|
<xpath expr="//field[@name='website_id']" position="after">
|
||||||
<field name="signifyd_case_required"/>
|
<field name="signifyd_case_required"/>
|
||||||
<field name="signifyd_coverage_type_ids"/>
|
<field name="signifyd_coverage_ids"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
<field name="secret_key" attrs="{'invisible': [('test_mode', '=', True)]}"/>
|
<field name="secret_key" attrs="{'invisible': [('test_mode', '=', True)]}"/>
|
||||||
<field name="secret_key_test" attrs="{'invisible': [('test_mode', '!=', True)]}"/>
|
<field name="secret_key_test" attrs="{'invisible': [('test_mode', '!=', True)]}"/>
|
||||||
<!-- <field name="signifyd_case_type" /> -->
|
<!-- <field name="signifyd_case_type" /> -->
|
||||||
<field name="signifyd_coverage_type_ids"/>
|
<field name="signifyd_coverage_ids"/>
|
||||||
<p class="text-muted">
|
<p class="text-muted">
|
||||||
Optional: Add users to be notified if a sale order is declined by Signifyd.
|
Optional: Add users to be notified if a sale order is declined by Signifyd.
|
||||||
</p>
|
</p>
|
||||||
@@ -145,4 +145,4 @@
|
|||||||
id="menu_action_signifyd_connector"
|
id="menu_action_signifyd_connector"
|
||||||
sequence="10" />
|
sequence="10" />
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
Reference in New Issue
Block a user