Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xueyun Qian
erp5
Commits
73ac2399
Commit
73ac2399
authored
May 27, 2011
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix stock listbox and add a new column 'order'.
parent
142a6384
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
302 additions
and
26 deletions
+302
-26
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getStockList.xml
...ateItem/portal_skins/erp5_trade/Delivery_getStockList.xml
+134
-0
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewInventory.xml
...teItem/portal_skins/erp5_trade/Delivery_viewInventory.xml
+2
-1
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewInventory/listbox.xml
...ortal_skins/erp5_trade/Delivery_viewInventory/listbox.xml
+6
-14
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewInventory/listbox_order_item.xml
.../erp5_trade/Delivery_viewInventory/listbox_order_item.xml
+23
-10
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewInventory/listbox_quantity_unit_item.xml
...ade/Delivery_viewInventory/listbox_quantity_unit_item.xml
+133
-0
bt5/erp5_trade/bt/change_log
bt5/erp5_trade/bt/change_log
+3
-0
bt5/erp5_trade/bt/revision
bt5/erp5_trade/bt/revision
+1
-1
No files found.
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getStockList.xml
0 → 100644
View file @
73ac2399
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
def getOrderStr(movement_list, resource_value):\n
order_str = \'\'\n
sum_quantity = movement_idx = 0\n
for movement_idx, movement in enumerate(movement_list):\n
quantity = movement.getQuantity()\n
quantity_unit_value = movement.getQuantityUnitValue()\n
if quantity_unit_value is None:\n
continue\n
\n
order_str += \'%s%.f%s\' % (movement_idx and \', \' or \'\', quantity,\n
quantity_unit_value.getShortTitle())\n
\n
sum_quantity += resource_value.convertQuantity(quantity,\n
movement.getQuantityUnit(),\n
resource_value.getDefaultQuantityUnit())\n
\n
if movement_idx >
0:\n
order_str += \' \' + context.Base_translateString(\'(${quantity}${quantity_unit} total)\',\n
mapping={\'quantity\': sum_quantity,\n
\'quantity_unit\': resource_value.getShortTitle()})\n
\n
return order_str\n
\n
movement_dict = {}\n
for movement in context.getMovementList():\n
movement_dict_key = movement.getResourceUid(), tuple(sorted(movement.getVariationCategoryList()))\n
if movement_dict_key in movement_dict:\n
movement_dict[movement_dict_key].append(movement)\n
else:\n
movement_dict[movement_dict_key] = [movement]\n
\n
line_list = []\n
order_dict = {}\n
for inventory in context.getFutureInventoryList(*args, **kwargs):\n
resource_value = inventory.getResourceValue()\n
dict_key = resource_value.getUid(), tuple(sorted(inventory.getVariationCategoryList()))\n
\n
try:\n
movement_list = movement_dict[dict_key]\n
del movement_dict[dict_key]\n
except KeyError:\n
pass\n
else:\n
order_dict[inventory.getUid()] = getOrderStr(movement_list, resource_value)\n
\n
line_list.append(inventory)\n
\n
if movement_dict:\n
for movement_list in movement_dict.values():\n
for movement in movement_list:\n
resource_value = movement.getResourceValue()\n
if resource_value is None:\n
continue\n
\n
temp_movement = movement.asContext(getCurrentInventory=str,\n
getAvailableInventory=str,\n
inventory=\'\')\n
\n
order_dict[movement.getUid()] = getOrderStr([movement], resource_value)\n
line_list.append(temp_movement)\n
\n
context.REQUEST.set(\'order_dict\', order_dict)\n
\n
return line_list\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
*args, **kwargs
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Delivery_getStockList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewInventory.xml
View file @
73ac2399
...
@@ -82,7 +82,8 @@
...
@@ -82,7 +82,8 @@
<value>
<value>
<list>
<list>
<string>
listbox_variation_category_item_list
</string>
<string>
listbox_variation_category_item_list
</string>
<string>
listbox_order_quantity_unit
</string>
<string>
listbox_order_item
</string>
<string>
listbox_quantity_unit_item
</string>
</list>
</list>
</value>
</value>
</item>
</item>
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewInventory/listbox.xml
View file @
73ac2399
...
@@ -131,16 +131,12 @@
...
@@ -131,16 +131,12 @@
<string>
Resource
</string>
<string>
Resource
</string>
</tuple>
</tuple>
<tuple>
<tuple>
<string>
variation_category_item_list
</string>
<string>
order_item
</string>
<string>
Variation
</string>
<string>
Order
</string>
</tuple>
<tuple>
<string>
getQuantity
</string>
<string>
Order Quantity
</string>
</tuple>
</tuple>
<tuple>
<tuple>
<string>
order_quantity_uni
t
</string>
<string>
variation_category_item_lis
t
</string>
<string>
Order Quantity Unit
</string>
<string>
Variation
</string>
</tuple>
</tuple>
<tuple>
<tuple>
<string>
getCurrentInventory
</string>
<string>
getCurrentInventory
</string>
...
@@ -155,7 +151,7 @@
...
@@ -155,7 +151,7 @@
<string>
Future
</string>
<string>
Future
</string>
</tuple>
</tuple>
<tuple>
<tuple>
<string>
getQuantityUnit
</string>
<string>
quantity_unit_item
</string>
<string>
Unit
</string>
<string>
Unit
</string>
</tuple>
</tuple>
</list>
</list>
...
@@ -192,10 +188,6 @@
...
@@ -192,10 +188,6 @@
<key>
<string>
editable_columns
</string>
</key>
<key>
<string>
editable_columns
</string>
</key>
<value>
<value>
<list>
<list>
<tuple>
<string>
order_quantity_unit
</string>
<string>
Order Quantity Unit
</string>
</tuple>
<tuple>
<tuple>
<string>
variation_category_item_list
</string>
<string>
variation_category_item_list
</string>
<string>
Variation
</string>
<string>
Variation
</string>
...
@@ -273,7 +265,7 @@
...
@@ -273,7 +265,7 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
method_name
</string>
</key>
<key>
<string>
method_name
</string>
</key>
<value>
<string>
getFutureInventory
List
</string>
</value>
<value>
<string>
Delivery_getStock
List
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewInventory/listbox_order_
quantity_unit
.xml
→
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewInventory/listbox_order_
item
.xml
View file @
73ac2399
...
@@ -10,13 +10,14 @@
...
@@ -10,13 +10,14 @@
<key>
<string>
delegated_list
</string>
</key>
<key>
<string>
delegated_list
</string>
</key>
<value>
<value>
<list>
<list>
<string>
items
</string>
<string>
default
</string>
<string>
title
</string>
</list>
</list>
</value>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
listbox_order_
quantity_unit
</string>
</value>
<value>
<string>
listbox_order_
item
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
message_values
</string>
</key>
<key>
<string>
message_values
</string>
</key>
...
@@ -52,6 +53,12 @@
...
@@ -52,6 +53,12 @@
<key>
<string>
tales
</string>
</key>
<key>
<string>
tales
</string>
</key>
<value>
<value>
<dictionary>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<item>
<key>
<string>
field_id
</string>
</key>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
...
@@ -61,13 +68,11 @@
...
@@ -61,13 +68,11 @@
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
items
</string>
</key>
<key>
<string>
target
</string>
</key>
<value>
<value>
<string></string>
</value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
t
arget
</string>
</key>
<key>
<string>
t
itle
</string>
</key>
<value>
<string></string>
</value>
<value>
<string></string>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
@@ -77,18 +82,26 @@
...
@@ -77,18 +82,26 @@
<key>
<string>
values
</string>
</key>
<key>
<string>
values
</string>
</key>
<value>
<value>
<dictionary>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<item>
<key>
<string>
field_id
</string>
</key>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_
view_mode_listbox_quantity_unit
</string>
</value>
<value>
<string>
my_
string_field
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
form_id
</string>
</key>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_view
Trade
FieldLibrary
</string>
</value>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
target
</string>
</key>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
listbox_order_item
</string>
</value>
</item>
</dictionary>
</dictionary>
</value>
</value>
</item>
</item>
...
@@ -103,7 +116,7 @@
...
@@ -103,7 +116,7 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
_text
</string>
</key>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python:
[(x.getTranslatedLogicalPath(), x.getCategoryRelativeUrl(base=0)) for x in cell.getResourceValue().getQuantityUnitValueList()] or [(\'\', \'\')]
</string>
</value>
<value>
<string>
python:
here.REQUEST.get(\'order_dict\').get(cell.getUid(), \'\')
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_viewInventory/listbox_quantity_unit_item.xml
0 → 100644
View file @
73ac2399
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
default
</string>
<string>
display_width
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
listbox_quantity_unit_item
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
display_width
</string>
</key>
<value>
<int>
20
</int>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_string_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
listbox_quantity_unit_item
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: cell.getResourceValue().getQuantityUnitTranslatedTitle()
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_trade/bt/change_log
View file @
73ac2399
2011-05-27 arnaud.fontaine
* Fix stock listbox and add a new column 'order'.
2011-04-14 yusei
2011-04-14 yusei
* Remove old unnecessary tales expression from relation string fields.
* Remove old unnecessary tales expression from relation string fields.
...
...
bt5/erp5_trade/bt/revision
View file @
73ac2399
1125
1126
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment