Skip to content
Permalink
Browse files

Sale + event_sale

  • Loading branch information...
tivisse committed Oct 9, 2019
1 parent bc948a5 commit 263cad08ed96eb35559c57640a9cd0bc7f7c5001
@@ -36,7 +36,7 @@ def setUp(self):

# I create a sales order
self.sale_order = self.env['sale.order'].create({
'partner_id': self.env.ref('base.res_partner_2').id,
'partner_id': self.env['res.partner'].create({'name': 'My Attendee'}).id,
'note': 'Invoice after delivery',
'payment_term_id': self.env.ref('account.account_payment_term_end_following_month').id
})
@@ -93,7 +93,7 @@ def test_event_is_registrable(self):
test_event_ticket = self.env['event.event.ticket'].create({
'name': 'TestTicket',
'event_id': test_event.id,
'product_id': 1,
'product_id': self.env['product.product'].search([], limit=1).id,
})
test_event_ticket.copy()
test_event_ticket.product_id.active = False
@@ -1,6 +1,7 @@
import odoo.tests
# Part of Odoo. See LICENSE file for full copyright and licensing details.

import odoo.tests


@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
@@ -67,8 +67,10 @@ def test_onchange_product_id(self):

def test_pricelist_application(self):
""" Test different prices are correctly applied based on dates """
support_product = self.env.ref('product.product_product_2')
support_product.list_price = 100
support_product = self.env['product.product'].create({
'name': 'Virtual Home Staging',
'list_price': 100,
})
partner = self.res_partner_model.create(dict(name="George"))

christmas_pricelist = self.env['product.pricelist'].create({
@@ -115,8 +117,10 @@ def test_pricelist_application(self):

def test_pricelist_uom_discount(self):
""" Test prices and discounts are correctly applied based on date and uom"""
computer_case = self.env.ref('product.product_product_16')
computer_case.list_price = 100
computer_case = self.env['product.product'].create({
'name': 'Drawer Black',
'list_price': 100,
})
partner = self.res_partner_model.create(dict(name="George"))
categ_unit_id = self.ref('uom.product_uom_categ_unit')
goup_discount_id = self.ref('product.group_discount_per_so_line')
@@ -167,8 +171,10 @@ def test_pricelist_uom_discount(self):

def test_pricelist_based_on_other(self):
""" Test price and discount are correctly applied with a pricelist based on an other one"""
computer_case = self.env.ref('product.product_product_16')
computer_case.list_price = 100
computer_case = self.env['product.product'].create({
'name': 'Drawer Black',
'list_price': 100,
})
partner = self.res_partner_model.create(dict(name="George"))
goup_discount_id = self.ref('product.group_discount_per_so_line')
self.env.user.write({'groups_id': [(4, goup_discount_id, 0)]})
@@ -217,7 +223,10 @@ def test_pricelist_based_on_other(self):

def test_pricelist_with_other_currency(self):
""" Test prices are correctly applied with a pricelist with an other currency"""
computer_case = self.env.ref('product.product_product_16')
computer_case = self.env['product.product'].create({
'name': 'Drawer Black',
'list_price': 100,
})
computer_case.list_price = 100
partner = self.res_partner_model.create(dict(name="George"))
categ_unit_id = self.ref('uom.product_uom_categ_unit')
@@ -253,19 +253,23 @@ def test_sale_with_taxes(self):

def test_so_create_multicompany(self):
# Preparing test Data
user_demo = self.env.ref('base.user_demo')
company_1 = self.env.ref('base.main_company')
company_2 = self.env['res.company'].create({
'name': 'company 2',
'parent_id': company_1.id,
})
user_demo.write({
'groups_id': [(4, self.env.ref('sales_team.group_sale_manager').id, False)],
user_demo = self.env['res.users'].create({
'login': 'zizizmyuser',
'password': 'zizizmyuser',
'partner_id': self.env['res.partner'].create({'name': 'Zizizmypartner'}).id,
'company_ids': [(6, False, [company_1.id])],
'company_id': company_1.id,
})
'groups_id': [(6, 0, [
self.env.ref('base.group_user').id,
self.env.ref('base.group_partner_manager').id,
self.env.ref('sales_team.group_sale_manager').id])]})

so_partner = self.env.ref('base.res_partner_2')
so_partner = self.env['res.partner'].create({'name': 'SO Partner'})
so_partner.write({
'property_account_position_id': False,
})

0 comments on commit 263cad0

Please sign in to comment.
You can’t perform that action at this time.