mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-28 06:12:01 +02:00
19.0 vanilla
This commit is contained in:
parent
79f83631d5
commit
73afc09215
6267 changed files with 1534193 additions and 1130106 deletions
|
|
@ -0,0 +1,30 @@
|
|||
from odoo import Command
|
||||
from odoo.tests import HttpCase, tagged
|
||||
from odoo.tools import mute_logger
|
||||
|
||||
|
||||
@tagged('-at_install', 'post_install')
|
||||
class TestPackagingTours(HttpCase):
|
||||
|
||||
def _get_product_url(self, product_id):
|
||||
return '/odoo/action-stock.product_template_action_product/%s' % (product_id)
|
||||
|
||||
def test_barcode_duplication_error(self):
|
||||
""" Test the barcode duplication error when creating a new product with an existing barcode """
|
||||
product_a = self.env['product.product'].create({
|
||||
'name': 'Product A',
|
||||
'is_storable': True,
|
||||
'tracking': 'none',
|
||||
'uom_id': self.env.ref('uom.product_uom_unit').id,
|
||||
'uom_ids': [Command.link(self.env.ref('uom.product_uom_pack_6').id)],
|
||||
'product_uom_ids': [Command.create({
|
||||
'barcode': 'test-1234',
|
||||
'uom_id': self.env.ref('uom.product_uom_pack_6').id,
|
||||
})]
|
||||
})
|
||||
url = self._get_product_url(product_a.product_tmpl_id.id)
|
||||
self.env['res.config.settings'].create({
|
||||
'group_uom': True,
|
||||
}).execute()
|
||||
with mute_logger('odoo.sql_db', 'odoo.http'):
|
||||
self.start_tour(url, 'test_barcode_duplication_error', login='admin', timeout=60)
|
||||
Loading…
Add table
Add a link
Reference in a new issue