mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 19:32:02 +02:00
Initial commit: Sale packages
This commit is contained in:
commit
14e3d26998
6469 changed files with 2479670 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import test_pos_sale_loyalty
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo.addons.pos_loyalty.tests.test_frontend import TestPoSLoyaltyCommon
|
||||
from odoo.tests import tagged
|
||||
|
||||
|
||||
@tagged("post_install", "-at_install")
|
||||
class TestPoSSaleLoyalty(TestPoSLoyaltyCommon):
|
||||
def test_pos_sale_loyalty_1(self):
|
||||
"""Test that only one loyalty card is created when settling an unconfirmed order."""
|
||||
self.env['loyalty.program'].search([]).write({'active': False})
|
||||
self.env['loyalty.program'].create({
|
||||
'name': 'Test Loyalty Program',
|
||||
'program_type': 'loyalty',
|
||||
'trigger': 'auto',
|
||||
'applies_on': 'both',
|
||||
'rule_ids': [
|
||||
(0, 0, {
|
||||
'reward_point_mode': 'money',
|
||||
'minimum_amount': 1,
|
||||
'reward_point_amount': 1,
|
||||
}),
|
||||
],
|
||||
'reward_ids': [
|
||||
(0, 0, {
|
||||
'reward_type': 'discount',
|
||||
'discount': 1,
|
||||
'required_points': 1000,
|
||||
'discount_mode': 'percent',
|
||||
'discount_applicability': 'order',
|
||||
}),
|
||||
],
|
||||
})
|
||||
self.env['sale.order'].create({
|
||||
'partner_id': self.partner_a.id,
|
||||
'order_line': [(0, 0, {
|
||||
'product_id': self.desk_organizer.id,
|
||||
'product_uom_qty': 1,
|
||||
'price_unit': 100,
|
||||
})]
|
||||
})
|
||||
|
||||
self.main_pos_config.open_ui()
|
||||
self.start_tour("/pos/web?config_id=%d" % self.main_pos_config.id, "PosSaleLoyaltyTour1", login="accountman")
|
||||
self.assertEqual(self.env['loyalty.card'].search_count([('partner_id', '=', self.partner_a.id)]), 1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue