Skip to content

Commit

Permalink
[FIX] quality_control: Several things:
Browse files Browse the repository at this point in the history
* not take into account inactivated tests trigger lines
* show action_cancel button in inspections even if it is autogenerated
  • Loading branch information
agaldona authored and pedrobaeza committed Aug 30, 2018
1 parent 272b44c commit 1605ec2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions quality_control/models/qc_trigger_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def get_trigger_line_for_product(self, trigger, product, partner=False):
for trigger_line in product.product_tmpl_id.qc_triggers.filtered(
lambda r: r.trigger == trigger and (
not r.partners or not partner or
partner.commercial_partner_id in r.partners)):
partner.commercial_partner_id in r.partners) and
r.test.active):
trigger_lines.add(trigger_line)
return trigger_lines

Expand All @@ -100,6 +101,7 @@ def get_trigger_line_for_product(self, trigger, product, partner=False):
for trigger_line in product.qc_triggers.filtered(
lambda r: r.trigger == trigger and (
not r.partners or not partner or
partner.commercial_partner_id in r.partners)):
partner.commercial_partner_id in r.partners) and
r.test.active):
trigger_lines.add(trigger_line)
return trigger_lines
2 changes: 1 addition & 1 deletion quality_control/views/qc_inspection_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
string="Approve" />
<button name="action_cancel"
type="object"
attrs="{'invisible': ['|', ('auto_generated', '=', True), ('state', 'not in', ['waiting', 'ready', 'failed', 'success'])]}"
attrs="{'invisible': [('state', 'not in', ['waiting', 'ready', 'failed', 'success'])]}"
string="Cancel"
icon="gtk-cancel" />
<field name="state"
Expand Down

0 comments on commit 1605ec2

Please sign in to comment.