Merge all kind of buttons
review483002
This commit is contained in:
1 parent
aceb0d4b1a
commit
708f2c4952
2 files changed
+11
-6
No files matched your search
@@ -87,6 +87,9 @@ class Forecast(Workflow, ModelSQL, ModelView):
|
||||
'confirm': {
|
||||
'invisible': Eval('state') != 'draft',
|
||||
},
|
||||
'complete': {
|
||||
'readonly': Eval('state') != 'draft',
|
||||
},
|
||||
})
|
||||
|
||||
def init(self, module_name):
|
||||
@@ -196,6 +199,10 @@ class Forecast(Workflow, ModelSQL, ModelView):
|
||||
def cancel(self, ids):
|
||||
pass
|
||||
|
||||
@ModelView.button_action('stock_forecast.wizard_forecast_complete')
|
||||
def complete(self, ids):
|
||||
pass
|
||||
|
||||
def create_moves(self, forecast_ids):
|
||||
'Create stock moves for the forecast ids'
|
||||
line_obj = Pool().get('stock.forecast.line')
|
||||
|
||||
+4
-6
@@ -39,9 +39,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="to_date"/>
|
||||
<label name="company"/>
|
||||
<field name="company"/>
|
||||
<button string="Complete Forecast" type="action"
|
||||
name="%(wizard_forecast_complete)d"
|
||||
states="{'readonly': Not(Equal(Eval('state'), 'draft'))}"
|
||||
<button string="Complete Forecast" name="complete"
|
||||
colspan="2"
|
||||
help="Add forecast line based on past data."/>
|
||||
<field name="lines" colspan="4"/>
|
||||
@@ -50,11 +48,11 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="state"/>
|
||||
<group colspan="2" col="3" id="buttons">
|
||||
<button string="Reset to Draft" name="draft"
|
||||
type="object" icon="tryton-clear"/>
|
||||
icon="tryton-clear"/>
|
||||
<button string="Cancel" name="cancel"
|
||||
type="object" icon="tryton-cancel"/>
|
||||
icon="tryton-cancel"/>
|
||||
<button string="Confirm" name="confirm"
|
||||
type="object" icon="tryton-ok"/>
|
||||
icon="tryton-ok"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
|
||||
Reference in new issue
Block a user