Skip to content

Commit

Permalink
Merge pull request osbzr#1840 from floraXiao/master
Browse files Browse the repository at this point in the history
[REM]删掉没用到的scan_barcode类及测试,test_production补全测试
  • Loading branch information
GoodERPJeff authored Jun 21, 2018
2 parents 34aa604 + 387352a commit d842618
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 91 deletions.
1 change: 0 additions & 1 deletion warehouse/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import goods
import warehouse_move
import scan_barcode
import warehouse_order
import inventory
import production
Expand Down
66 changes: 0 additions & 66 deletions warehouse/models/scan_barcode.py

This file was deleted.

2 changes: 1 addition & 1 deletion warehouse/models/warehouse_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class WhOut(models.Model):
_name = 'wh.out'
_description = u'其他出库单'
_inherit = ['mail.thread', 'scan.barcode']
_inherit = ['mail.thread']
_order = 'date DESC, id DESC'

_inherits = {
Expand Down
1 change: 0 additions & 1 deletion warehouse/security/ir.model.access.csv
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ access_report_base,access_report_base,warehouse.model_report_base,,1,1,1,1
access_report_stock_balance,access_report_stock_balance,warehouse.model_report_stock_balance,,1,1,1,1
access_report_stock_transceive,access_report_stock_transceive,warehouse.model_report_stock_transceive,,1,1,1,1
access_qc_rule,access_qc_rule,warehouse.model_qc_rule,,1,1,1,1
access_scan_barcode,access_scan_barcode,model_scan_barcode,,1,0,0,0
access_location_all_group,access_location_all_group,model_location,,1,1,1,1
1 change: 0 additions & 1 deletion warehouse/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
import test_warehouse
import test_warehouse_order
import test_qc_rule
import test_scan_barcode
import test_location
28 changes: 27 additions & 1 deletion warehouse/tests/test_production.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from odoo.tests.common import TransactionCase
from odoo.exceptions import UserError
from odoo.exceptions import UserError, ValidationError


class TestProduction(TransactionCase):
Expand Down Expand Up @@ -669,3 +669,29 @@ def test_outsource_approve_feeding_twice(self):
self.outsource_out1.cancel_approved_order()
with self.assertRaises(UserError):
self.outsource_out1.cancel_approved_order()


class TestWhBom(TransactionCase):
''' 测试物料清单明细 '''

def setUp(self):
super(TestWhBom, self).setUp()
self.bom = self.env.ref('warehouse.wh_bom_0')

def test_check_parent_child_unique(self):
'''判断同一个产品不能是组合件又是子件'''
with self.assertRaises(ValidationError):
self.bom.write({'line_child_ids': [(0, 0, {'goods_id': self.env.ref('goods.keyboard_mouse').id})]})


class TestWhBomLine(TransactionCase):
''' 测试物料清单明细 '''

def setUp(self):
super(TestWhBomLine, self).setUp()
self.bom = self.env.ref('warehouse.wh_bom_0')

def test_check_goods_qty(self):
'''验证商品数量大于0'''
with self.assertRaises(ValidationError):
self.bom.line_child_ids[0].goods_qty = 0
19 changes: 0 additions & 19 deletions warehouse/tests/test_scan_barcode.py

This file was deleted.

1 change: 0 additions & 1 deletion warehouse/view/warehouse_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@
<label string="扫描条码"/>
<input type='text' class="ge_scan_barcode" autofocus="true"/>
</div>
<!--<field name='scan_barcode_input_code' style="width:100%; max-width:100%;" class="o_form_editable"/>-->
<group>
<group>
<field name='partner_id' attrs="{'readonly': [('state', '!=', 'draft')]}"
Expand Down

0 comments on commit d842618

Please sign in to comment.