Skip to content

Commit

Permalink
Merge pull request #60 from prakashpp/develop
Browse files Browse the repository at this point in the history
Fix state action for import/export order #6750
  • Loading branch information
tarunbhardwaj committed Jan 20, 2015
2 parents e9a72ee + 2584270 commit ee8607f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
16 changes: 7 additions & 9 deletions sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from trytond.transaction import Transaction
from trytond.exceptions import UserError
from trytond.pool import PoolMeta, Pool
from trytond.pyson import Eval, Not, Bool, PYSONEncoder
from trytond.pyson import Eval, Not, Bool
from trytond.wizard import Wizard, StateView, Button, StateAction


Expand Down Expand Up @@ -617,7 +617,7 @@ class ImportOrders(Wizard):
]
)

import_ = StateAction('sale.act_sale_form')
import_ = StateAction('magento.act_sale_form_all')

def default_start(self, data):
"""
Expand All @@ -642,9 +642,8 @@ def do_import_(self, action):

sales = store_view.import_order_from_store_view()

action['pyson_domain'] = PYSONEncoder().encode(
[('id', 'in', map(int, sales))])
return action, {}
data = {'res_id': [sale.id for sale in sales]}
return action, data

def transition_import_(self):
return 'end'
Expand Down Expand Up @@ -674,7 +673,7 @@ class ExportOrderStatus(Wizard):
]
)

export_ = StateAction('sale.act_sale_form')
export_ = StateAction('magento.act_sale_form_all')

def default_start(self, data):
"""
Expand All @@ -698,9 +697,8 @@ def do_export_(self, action):

sales = store_view.export_order_status_for_store_view()

action['pyson_domain'] = PYSONEncoder().encode(
[('id', 'in', map(int, sales))])
return action, {}
data = {'res_id': [sale.id for sale in sales]}
return action, data

def transition_export_(self):
return 'end'
Expand Down
15 changes: 15 additions & 0 deletions sale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@
<field name="name">sale_form</field>
</record>

<record model="ir.action.act_window" id="act_sale_form_all">
<field name="name">Sales</field>
<field name="res_model">sale.sale</field>
</record>
<record model="ir.action.act_window.view" id="act_sale_form_view1">
<field name="sequence" eval="10"/>
<field name="view" ref="sale.sale_view_tree"/>
<field name="act_window" ref="act_sale_form_all"/>
</record>
<record model="ir.action.act_window.view" id="act_sale_form_view2">
<field name="sequence" eval="20"/>
<field name="view" ref="sale.sale_view_form"/>
<field name="act_window" ref="act_sale_form_all"/>
</record>

<!--Sale Line -->
<record model="ir.ui.view" id="sale_line_view_form">
<field name="model">sale.line</field>
Expand Down

0 comments on commit ee8607f

Please sign in to comment.