Commit a4c33bde authored by Rafael Monnerat's avatar Rafael Monnerat

Update upstream/master

parents 0cf19127 da7a6e26
<property_sheet_list> <property_sheet_list>
<portal_type id="Account Type Constraint">
<item>ConstraintType</item>
</portal_type>
<portal_type id="Accounting Transaction"> <portal_type id="Accounting Transaction">
<item>AccountingTransactionConstraint</item> <item>AccountingTransactionConstraint</item>
</portal_type> </portal_type>
<portal_type id="Accounting Transaction Balance Constraint">
<item>ConstraintType</item>
</portal_type>
<portal_type id="Accounting Transaction Line"> <portal_type id="Accounting Transaction Line">
<item>AccountingTransactionLineConstraint</item> <item>AccountingTransactionLineConstraint</item>
</portal_type> </portal_type>
......
Account Type Constraint | ConstraintType
Accounting Transaction Balance Constraint | ConstraintType
Accounting Transaction Line | AccountingTransactionLineConstraint Accounting Transaction Line | AccountingTransactionLineConstraint
Accounting Transaction | AccountingTransactionConstraint Accounting Transaction | AccountingTransactionConstraint
Balance Transaction Line | AccountingTransactionLineConstraint Balance Transaction Line | AccountingTransactionLineConstraint
......
<property_sheet_list>
<portal_type id="Missing Category Document Constraint">
<item>ConstraintType</item>
</portal_type>
</property_sheet_list>
\ No newline at end of file
Missing Category Document Constraint | ConstraintType
\ No newline at end of file
import json import json
import oauth2client.client import oauth2client.client
import oauth2client.transport
from Products.ERP5Security.ERP5ExternalOauth2ExtractionPlugin import getGoogleUserEntry from Products.ERP5Security.ERP5ExternalOauth2ExtractionPlugin import getGoogleUserEntry
from zExceptions import Unauthorized from zExceptions import Unauthorized
SCOPE_LIST = ['https://www.googleapis.com/auth/userinfo.profile', SCOPE_LIST = ['https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/userinfo.email'] 'https://www.googleapis.com/auth/userinfo.email']
# Default timeout (in seconds) for the HTTP request made to google servers to
# exchange the authorization code for a token.
DEFAULT_HTTP_TIMEOUT = 10
def _getGoogleClientIdAndSecretKey(portal, reference="default"): def _getGoogleClientIdAndSecretKey(portal, reference="default"):
...@@ -33,7 +37,7 @@ def redirectToGoogleLoginPage(self): ...@@ -33,7 +37,7 @@ def redirectToGoogleLoginPage(self):
include_granted_scopes="true") include_granted_scopes="true")
self.REQUEST.RESPONSE.redirect(flow.step1_get_authorize_url()) self.REQUEST.RESPONSE.redirect(flow.step1_get_authorize_url())
def getAccessTokenFromCode(self, code, redirect_uri): def getAccessTokenFromCode(self, code, redirect_uri, timeout=DEFAULT_HTTP_TIMEOUT):
client_id, secret_key = _getGoogleClientIdAndSecretKey(self.getPortalObject()) client_id, secret_key = _getGoogleClientIdAndSecretKey(self.getPortalObject())
flow = oauth2client.client.OAuth2WebServerFlow( flow = oauth2client.client.OAuth2WebServerFlow(
client_id=client_id, client_id=client_id,
...@@ -42,7 +46,9 @@ def getAccessTokenFromCode(self, code, redirect_uri): ...@@ -42,7 +46,9 @@ def getAccessTokenFromCode(self, code, redirect_uri):
redirect_uri=redirect_uri, redirect_uri=redirect_uri,
access_type="offline", access_type="offline",
include_granted_scopes="true") include_granted_scopes="true")
credential = flow.step2_exchange(code) credential = flow.step2_exchange(
code,
http=oauth2client.transport.get_http_object(timeout=timeout))
credential_data = json.loads(credential.to_json()) credential_data = json.loads(credential.to_json())
return credential_data return credential_data
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
<item>DefaultImage</item> <item>DefaultImage</item>
<item>Reference</item> <item>Reference</item>
</portal_type> </portal_type>
<portal_type id="Resource Measures Consistency Constraint">
<item>ConstraintType</item>
</portal_type>
<portal_type id="Service Individual Variation"> <portal_type id="Service Individual Variation">
<item>DefaultImage</item> <item>DefaultImage</item>
</portal_type> </portal_type>
......
...@@ -4,5 +4,6 @@ Measure Cell | Amount ...@@ -4,5 +4,6 @@ Measure Cell | Amount
Product Individual Variation | DefaultImage Product Individual Variation | DefaultImage
Product Individual Variation | Reference Product Individual Variation | Reference
Product | DefaultImage Product | DefaultImage
Resource Measures Consistency Constraint | ConstraintType
Service Individual Variation | DefaultImage Service Individual Variation | DefaultImage
Supply Cell | Reference Supply Cell | Reference
\ No newline at end of file
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
<portal_type id="Delivery Node"> <portal_type id="Delivery Node">
<item>DeliveryNode</item> <item>DeliveryNode</item>
</portal_type> </portal_type>
<portal_type id="Duplicate Inventory Constraint">
<item>ConstraintType</item>
</portal_type>
<portal_type id="Internal Packing List"> <portal_type id="Internal Packing List">
<item>DeliveryCausalityStateConstraint</item> <item>DeliveryCausalityStateConstraint</item>
</portal_type> </portal_type>
...@@ -31,6 +34,9 @@ ...@@ -31,6 +34,9 @@
<portal_type id="Sale Trade Condition"> <portal_type id="Sale Trade Condition">
<item>PaymentCondition</item> <item>PaymentCondition</item>
</portal_type> </portal_type>
<portal_type id="Trade Model Line Cell Consistency Constraint">
<item>ConstraintType</item>
</portal_type>
<portal_type id="Trade Model Path"> <portal_type id="Trade Model Path">
<item>PaymentCondition</item> <item>PaymentCondition</item>
</portal_type> </portal_type>
......
Business Process | Reference Business Process | Reference
Business Process | Version Business Process | Version
Delivery Node | DeliveryNode Delivery Node | DeliveryNode
Duplicate Inventory Constraint | ConstraintType
Internal Packing List | DeliveryCausalityStateConstraint Internal Packing List | DeliveryCausalityStateConstraint
Inventory Report | Arrow Inventory Report | Arrow
Inventory Report | InventoryReport Inventory Report | InventoryReport
...@@ -10,4 +11,5 @@ Returned Sale Packing List | DeliveryCausalityStateConstraint ...@@ -10,4 +11,5 @@ Returned Sale Packing List | DeliveryCausalityStateConstraint
Sale Order | PaymentCondition Sale Order | PaymentCondition
Sale Packing List | DeliveryCausalityStateConstraint Sale Packing List | DeliveryCausalityStateConstraint
Sale Trade Condition | PaymentCondition Sale Trade Condition | PaymentCondition
Trade Model Line Cell Consistency Constraint | ConstraintType
Trade Model Path | PaymentCondition Trade Model Path | PaymentCondition
\ No newline at end of file
...@@ -774,7 +774,8 @@ CREATE TABLE %s ( ...@@ -774,7 +774,8 @@ CREATE TABLE %s (
b" processing_node=0 AND" b" processing_node=0 AND"
b" %s%s" b" %s%s"
b" ORDER BY priority, date" b" ORDER BY priority, date"
b" LIMIT %i" % args, b" LIMIT %i"
b" FOR UPDATE" % args,
0, 0,
)) ))
else: else:
...@@ -787,6 +788,7 @@ CREATE TABLE %s ( ...@@ -787,6 +788,7 @@ CREATE TABLE %s (
b" %s%s" b" %s%s"
b" ORDER BY priority, date" b" ORDER BY priority, date"
b" LIMIT %i" b" LIMIT %i"
b" FOR UPDATE"
b")" % args).format b")" % args).format
result = Results(query( result = Results(query(
b"SELECT *" b"SELECT *"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment