[IMP] sale: Remove useless SO line values on creation
Purpose ======= Those are now the default values that are computed from the field definition.
This commit is contained in:
@@ -49,10 +49,7 @@ class TestEventSale(TestEventSaleCommon):
|
||||
cls.env['sale.order.line'].create({
|
||||
'product_id': product.id,
|
||||
'price_unit': 190.50,
|
||||
'product_uom': cls.env.ref('uom.product_uom_unit').id,
|
||||
'product_uom_qty': 1.0,
|
||||
'order_id': cls.sale_order.id,
|
||||
'name': 'sales order line',
|
||||
'event_id': cls.event_0.id,
|
||||
'event_ticket_id': cls.ticket.id,
|
||||
})
|
||||
@@ -238,10 +235,7 @@ class TestEventSale(TestEventSaleCommon):
|
||||
'pricelist_id': pricelist.id,
|
||||
})
|
||||
sol = self.env['sale.order.line'].create({
|
||||
'name': event.name,
|
||||
'product_id': event_product.product_variant_id.id,
|
||||
'product_uom_qty': 1,
|
||||
'product_uom': event_product.uom_id.id,
|
||||
'order_id': so.id,
|
||||
'event_id': event.id,
|
||||
'event_ticket_id': event_ticket.id,
|
||||
|
||||
@@ -38,21 +38,15 @@ class TestReInvoice(TestSaleCommon):
|
||||
""" Test vendor bill at cost for product based on ordered and delivered quantities. """
|
||||
# create SO line and confirm SO (with only one line)
|
||||
sale_order_line1 = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_order_cost'].name,
|
||||
'product_id': self.company_data['product_order_cost'].id,
|
||||
'product_uom_qty': 2,
|
||||
'qty_delivered': 1,
|
||||
'product_uom': self.company_data['product_order_cost'].uom_id.id,
|
||||
'price_unit': self.company_data['product_order_cost'].list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
sale_order_line2 = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_delivery_cost'].name,
|
||||
'product_id': self.company_data['product_delivery_cost'].id,
|
||||
'product_uom_qty': 4,
|
||||
'qty_delivered': 1,
|
||||
'product_uom': self.company_data['product_delivery_cost'].uom_id.id,
|
||||
'price_unit': self.company_data['product_delivery_cost'].list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
|
||||
@@ -154,21 +148,15 @@ class TestReInvoice(TestSaleCommon):
|
||||
"""
|
||||
# create SO line and confirm SO (with only one line)
|
||||
sale_order_line1 = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_delivery_sales_price'].name,
|
||||
'product_id': self.company_data['product_delivery_sales_price'].id,
|
||||
'product_uom_qty': 2,
|
||||
'qty_delivered': 1,
|
||||
'product_uom': self.company_data['product_delivery_sales_price'].uom_id.id,
|
||||
'price_unit': self.company_data['product_delivery_sales_price'].list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
sale_order_line2 = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_order_sales_price'].name,
|
||||
'product_id': self.company_data['product_order_sales_price'].id,
|
||||
'product_uom_qty': 3,
|
||||
'qty_delivered': 1,
|
||||
'product_uom': self.company_data['product_order_sales_price'].uom_id.id,
|
||||
'price_unit': self.company_data['product_order_sales_price'].list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
self.sale_order.action_confirm()
|
||||
@@ -230,12 +218,9 @@ class TestReInvoice(TestSaleCommon):
|
||||
""" Test invoicing vendor bill with no policy. Check nothing happen. """
|
||||
# confirm SO
|
||||
sale_order_line = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_delivery_no'].name,
|
||||
'product_id': self.company_data['product_delivery_no'].id,
|
||||
'product_uom_qty': 2,
|
||||
'qty_delivered': 1,
|
||||
'product_uom': self.company_data['product_delivery_no'].uom_id.id,
|
||||
'price_unit': self.company_data['product_delivery_no'].list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
self.sale_order.action_confirm()
|
||||
@@ -256,20 +241,12 @@ class TestReInvoice(TestSaleCommon):
|
||||
def test_not_reinvoicing_invoiced_so_lines(self):
|
||||
""" Test that invoiced SO lines are not re-invoiced. """
|
||||
so_line1 = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_delivery_cost'].name,
|
||||
'product_id': self.company_data['product_delivery_cost'].id,
|
||||
'product_uom_qty': 1,
|
||||
'product_uom': self.company_data['product_delivery_cost'].uom_id.id,
|
||||
'price_unit': self.company_data['product_delivery_cost'].list_price,
|
||||
'discount': 100.00,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
so_line2 = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_delivery_sales_price'].name,
|
||||
'product_id': self.company_data['product_delivery_sales_price'].id,
|
||||
'product_uom_qty': 1,
|
||||
'product_uom': self.company_data['product_delivery_sales_price'].uom_id.id,
|
||||
'price_unit': self.company_data['product_delivery_sales_price'].list_price,
|
||||
'discount': 100.00,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
|
||||
@@ -50,38 +50,26 @@ class TestSaleOrder(TestSaleCommon):
|
||||
'pricelist_id': cls.company_data['default_pricelist'].id,
|
||||
})
|
||||
cls.sol_product_order = cls.env['sale.order.line'].create({
|
||||
'name': cls.company_data['product_order_no'].name,
|
||||
'product_id': cls.company_data['product_order_no'].id,
|
||||
'product_uom_qty': 2,
|
||||
'product_uom': cls.company_data['product_order_no'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_order_no'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol_serv_deliver = cls.env['sale.order.line'].create({
|
||||
'name': cls.company_data['product_service_delivery'].name,
|
||||
'product_id': cls.company_data['product_service_delivery'].id,
|
||||
'product_uom_qty': 2,
|
||||
'product_uom': cls.company_data['product_service_delivery'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_service_delivery'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol_serv_order = cls.env['sale.order.line'].create({
|
||||
'name': cls.company_data['product_service_order'].name,
|
||||
'product_id': cls.company_data['product_service_order'].id,
|
||||
'product_uom_qty': 2,
|
||||
'product_uom': cls.company_data['product_service_order'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_service_order'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol_product_deliver = cls.env['sale.order.line'].create({
|
||||
'name': cls.company_data['product_delivery_no'].name,
|
||||
'product_id': cls.company_data['product_delivery_no'].id,
|
||||
'product_uom_qty': 2,
|
||||
'product_uom': cls.company_data['product_delivery_no'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_delivery_no'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
|
||||
@@ -80,38 +80,26 @@ class TestSaleOrder(TestSaleCommon):
|
||||
'pricelist_id': cls.company_data['default_pricelist'].id,
|
||||
})
|
||||
cls.sol_product_order = SaleOrderLine.create({
|
||||
'name': cls.company_data['product_order_no'].name,
|
||||
'product_id': cls.company_data['product_order_no'].id,
|
||||
'product_uom_qty': 2,
|
||||
'product_uom': cls.company_data['product_order_no'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_order_no'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol_serv_deliver = SaleOrderLine.create({
|
||||
'name': cls.company_data['product_service_delivery'].name,
|
||||
'product_id': cls.company_data['product_service_delivery'].id,
|
||||
'product_uom_qty': 2,
|
||||
'product_uom': cls.company_data['product_service_delivery'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_service_delivery'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol_serv_order = SaleOrderLine.create({
|
||||
'name': cls.company_data['product_service_order'].name,
|
||||
'product_id': cls.company_data['product_service_order'].id,
|
||||
'product_uom_qty': 2,
|
||||
'product_uom': cls.company_data['product_service_order'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_service_order'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol_prod_deliver = SaleOrderLine.create({
|
||||
'name': cls.company_data['product_delivery_no'].name,
|
||||
'product_id': cls.company_data['product_delivery_no'].id,
|
||||
'product_uom_qty': 2,
|
||||
'product_uom': cls.company_data['product_delivery_no'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_delivery_no'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
|
||||
@@ -21,38 +21,26 @@ class TestSaleToInvoice(TestSaleCommon):
|
||||
})
|
||||
SaleOrderLine = cls.env['sale.order.line'].with_context(tracking_disable=True)
|
||||
cls.sol_prod_order = SaleOrderLine.create({
|
||||
'name': cls.company_data['product_order_no'].name,
|
||||
'product_id': cls.company_data['product_order_no'].id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': cls.company_data['product_order_no'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_order_no'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol_serv_deliver = SaleOrderLine.create({
|
||||
'name': cls.company_data['product_service_delivery'].name,
|
||||
'product_id': cls.company_data['product_service_delivery'].id,
|
||||
'product_uom_qty': 4,
|
||||
'product_uom': cls.company_data['product_service_delivery'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_service_delivery'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol_serv_order = SaleOrderLine.create({
|
||||
'name': cls.company_data['product_service_order'].name,
|
||||
'product_id': cls.company_data['product_service_order'].id,
|
||||
'product_uom_qty': 3,
|
||||
'product_uom': cls.company_data['product_service_order'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_service_order'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol_prod_deliver = SaleOrderLine.create({
|
||||
'name': cls.company_data['product_delivery_no'].name,
|
||||
'product_id': cls.company_data['product_delivery_no'].id,
|
||||
'product_uom_qty': 2,
|
||||
'product_uom': cls.company_data['product_delivery_no'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_delivery_no'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
@@ -329,11 +317,8 @@ class TestSaleToInvoice(TestSaleCommon):
|
||||
'pricelist_id': self.company_data['default_pricelist'].id,
|
||||
})
|
||||
sol_product = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_order_no'].name,
|
||||
'product_id': self.company_data['product_order_no'].id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': self.company_data['product_order_no'].uom_id.id,
|
||||
'price_unit': self.company_data['product_order_no'].list_price,
|
||||
'order_id': sale_order_refund.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
|
||||
@@ -22,38 +22,26 @@ class TestSaleToInvoice(TestSaleCommon):
|
||||
})
|
||||
SaleOrderLine = cls.env['sale.order.line'].with_context(tracking_disable=True)
|
||||
cls.sol_prod_order = SaleOrderLine.create({
|
||||
'name': cls.company_data['product_order_no'].name,
|
||||
'product_id': cls.company_data['product_order_no'].id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': cls.company_data['product_order_no'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_order_no'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol_serv_deliver = SaleOrderLine.create({
|
||||
'name': cls.company_data['product_service_delivery'].name,
|
||||
'product_id': cls.company_data['product_service_delivery'].id,
|
||||
'product_uom_qty': 4,
|
||||
'product_uom': cls.company_data['product_service_delivery'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_service_delivery'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol_serv_order = SaleOrderLine.create({
|
||||
'name': cls.company_data['product_service_order'].name,
|
||||
'product_id': cls.company_data['product_service_order'].id,
|
||||
'product_uom_qty': 3,
|
||||
'product_uom': cls.company_data['product_service_order'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_service_order'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol_prod_deliver = SaleOrderLine.create({
|
||||
'name': cls.company_data['product_delivery_no'].name,
|
||||
'product_id': cls.company_data['product_delivery_no'].id,
|
||||
'product_uom_qty': 2,
|
||||
'product_uom': cls.company_data['product_delivery_no'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_delivery_no'].list_price,
|
||||
'order_id': cls.sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
@@ -296,11 +284,8 @@ class TestSaleToInvoice(TestSaleCommon):
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
sol_prod_deliver = SaleOrderLine.create({
|
||||
'name': self.company_data['product_order_no'].name,
|
||||
'product_id': self.company_data['product_order_no'].id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': self.company_data['product_order_no'].uom_id.id,
|
||||
'price_unit': self.company_data['product_order_no'].list_price,
|
||||
'order_id': sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
@@ -339,11 +324,8 @@ class TestSaleToInvoice(TestSaleCommon):
|
||||
|
||||
SaleOrderLine = self.env['sale.order.line'].with_context(tracking_disable=True)
|
||||
sol_prod_deliver = SaleOrderLine.create({
|
||||
'name': self.company_data['product_order_no'].name,
|
||||
'product_id': self.company_data['product_order_no'].id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': self.company_data['product_order_no'].uom_id.id,
|
||||
'price_unit': self.company_data['product_order_no'].list_price,
|
||||
'order_id': sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
|
||||
@@ -43,8 +43,6 @@ class SaleOrder(models.Model):
|
||||
self.env["sale.order.line"].create({
|
||||
'product_id': pay_gift_card_id.id,
|
||||
'price_unit': - amount,
|
||||
'product_uom_qty': 1,
|
||||
'product_uom': pay_gift_card_id.uom_id.id,
|
||||
'gift_card_id': gift_card.id,
|
||||
'order_id': self.id
|
||||
})
|
||||
|
||||
@@ -91,38 +91,26 @@ class TestSaleProject(TransactionCase):
|
||||
'partner_shipping_id': partner.id,
|
||||
})
|
||||
so_line_order_no_task = SaleOrderLine.create({
|
||||
'name': self.product_order_service1.name,
|
||||
'product_id': self.product_order_service1.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': self.product_order_service1.uom_id.id,
|
||||
'price_unit': self.product_order_service1.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
|
||||
so_line_order_task_in_global = SaleOrderLine.create({
|
||||
'name': self.product_order_service2.name,
|
||||
'product_id': self.product_order_service2.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': self.product_order_service2.uom_id.id,
|
||||
'price_unit': self.product_order_service2.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
|
||||
so_line_order_new_task_new_project = SaleOrderLine.create({
|
||||
'name': self.product_order_service3.name,
|
||||
'product_id': self.product_order_service3.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': self.product_order_service3.uom_id.id,
|
||||
'price_unit': self.product_order_service3.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
|
||||
so_line_order_only_project = SaleOrderLine.create({
|
||||
'name': self.product_order_service4.name,
|
||||
'product_id': self.product_order_service4.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': self.product_order_service4.uom_id.id,
|
||||
'price_unit': self.product_order_service4.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
sale_order.action_confirm()
|
||||
|
||||
@@ -39,11 +39,8 @@ class TestAccessRights(TestCommonSalePurchaseNoChart):
|
||||
})
|
||||
|
||||
sol_service_purchase = self.env['sale.order.line'].with_user(self.user_salesperson).create({
|
||||
'name': self.service_purchase_1.name,
|
||||
'product_id': self.service_purchase_1.id,
|
||||
'product_uom_qty': 4,
|
||||
'product_uom': self.service_purchase_1.uom_id.id,
|
||||
'price_unit': self.service_purchase_1.list_price,
|
||||
'order_id': sale_order.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
|
||||
@@ -22,29 +22,20 @@ class TestSalePurchase(TestCommonSalePurchaseNoChart):
|
||||
'pricelist_id': cls.company_data['default_pricelist'].id,
|
||||
})
|
||||
cls.sol1_service_deliver = cls.env['sale.order.line'].create({
|
||||
'name': cls.company_data['product_service_delivery'].name,
|
||||
'product_id': cls.company_data['product_service_delivery'].id,
|
||||
'product_uom_qty': 1,
|
||||
'product_uom': cls.company_data['product_service_delivery'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_service_delivery'].list_price,
|
||||
'order_id': cls.sale_order_1.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol1_product_order = cls.env['sale.order.line'].create({
|
||||
'name': cls.company_data['product_order_no'].name,
|
||||
'product_id': cls.company_data['product_order_no'].id,
|
||||
'product_uom_qty': 2,
|
||||
'product_uom': cls.company_data['product_order_no'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_order_no'].list_price,
|
||||
'order_id': cls.sale_order_1.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol1_service_purchase_1 = cls.env['sale.order.line'].create({
|
||||
'name': cls.service_purchase_1.name,
|
||||
'product_id': cls.service_purchase_1.id,
|
||||
'product_uom_qty': 4,
|
||||
'product_uom': cls.service_purchase_1.uom_id.id,
|
||||
'price_unit': cls.service_purchase_1.list_price,
|
||||
'order_id': cls.sale_order_1.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
@@ -56,29 +47,20 @@ class TestSalePurchase(TestCommonSalePurchaseNoChart):
|
||||
'pricelist_id': cls.company_data['default_pricelist'].id,
|
||||
})
|
||||
cls.sol2_product_deliver = cls.env['sale.order.line'].create({
|
||||
'name': cls.company_data['product_delivery_no'].name,
|
||||
'product_id': cls.company_data['product_delivery_no'].id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': cls.company_data['product_delivery_no'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_delivery_no'].list_price,
|
||||
'order_id': cls.sale_order_2.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol2_service_order = cls.env['sale.order.line'].create({
|
||||
'name': cls.company_data['product_service_order'].name,
|
||||
'product_id': cls.company_data['product_service_order'].id,
|
||||
'product_uom_qty': 6,
|
||||
'product_uom': cls.company_data['product_service_order'].uom_id.id,
|
||||
'price_unit': cls.company_data['product_service_order'].list_price,
|
||||
'order_id': cls.sale_order_2.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
cls.sol2_service_purchase_2 = cls.env['sale.order.line'].create({
|
||||
'name': cls.service_purchase_2.name,
|
||||
'product_id': cls.service_purchase_2.id,
|
||||
'product_uom_qty': 7,
|
||||
'product_uom': cls.service_purchase_2.uom_id.id,
|
||||
'price_unit': cls.service_purchase_2.list_price,
|
||||
'order_id': cls.sale_order_2.id,
|
||||
'tax_id': False,
|
||||
})
|
||||
|
||||
@@ -351,10 +351,8 @@ class TestCommonSaleTimesheet(TestSaleCommon):
|
||||
})
|
||||
self.env['sale.order.line'].create([{
|
||||
'order_id': self.so.id,
|
||||
'name': self.product_delivery_timesheet1.name,
|
||||
'product_id': self.product_delivery_timesheet1.id,
|
||||
'product_uom_qty': 10,
|
||||
'price_unit': self.product_delivery_timesheet1.list_price
|
||||
}, {
|
||||
'order_id': self.so.id,
|
||||
'product_id': self.product_delivery_timesheet2.id,
|
||||
|
||||
@@ -52,19 +52,13 @@ class TestCommonReporting(TestCommonSaleTimesheet):
|
||||
'analytic_account_id': cls.analytic_account_1.id,
|
||||
})
|
||||
cls.so_line_deliver_project = cls.env['sale.order.line'].create({
|
||||
'name': cls.product_delivery_timesheet3.name,
|
||||
'product_id': cls.product_delivery_timesheet3.id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': cls.product_delivery_timesheet3.uom_id.id,
|
||||
'price_unit': cls.product_delivery_timesheet3.list_price,
|
||||
'order_id': cls.sale_order_1.id,
|
||||
})
|
||||
cls.so_line_deliver_task = cls.env['sale.order.line'].create({
|
||||
'name': cls.product_delivery_timesheet2.name,
|
||||
'product_id': cls.product_delivery_timesheet2.id,
|
||||
'product_uom_qty': 7,
|
||||
'product_uom': cls.product_delivery_timesheet2.uom_id.id,
|
||||
'price_unit': cls.product_delivery_timesheet2.list_price,
|
||||
'order_id': cls.sale_order_1.id,
|
||||
})
|
||||
|
||||
@@ -75,19 +69,13 @@ class TestCommonReporting(TestCommonSaleTimesheet):
|
||||
'analytic_account_id': cls.analytic_account_2.id,
|
||||
})
|
||||
cls.so_line_order_project = cls.env['sale.order.line'].create({
|
||||
'name': cls.product_order_timesheet3.name,
|
||||
'product_id': cls.product_order_timesheet3.id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': cls.product_order_timesheet3.uom_id.id,
|
||||
'price_unit': cls.product_order_timesheet3.list_price,
|
||||
'order_id': cls.sale_order_2.id,
|
||||
})
|
||||
cls.so_line_order_task = cls.env['sale.order.line'].create({
|
||||
'name': cls.product_order_timesheet2.name,
|
||||
'product_id': cls.product_order_timesheet2.id,
|
||||
'product_uom_qty': 7,
|
||||
'product_uom': cls.product_order_timesheet2.uom_id.id,
|
||||
'price_unit': cls.product_order_timesheet2.list_price,
|
||||
'order_id': cls.sale_order_2.id,
|
||||
})
|
||||
|
||||
@@ -98,11 +86,8 @@ class TestCommonReporting(TestCommonSaleTimesheet):
|
||||
'analytic_account_id': cls.analytic_account_3.id,
|
||||
})
|
||||
cls.so_line_deliver_manual_project = cls.env['sale.order.line'].create({
|
||||
'name': cls.product_delivery_manual3.name,
|
||||
'product_id': cls.product_delivery_manual3.id,
|
||||
'product_uom_qty': 11,
|
||||
'product_uom': cls.product_delivery_manual3.uom_id.id,
|
||||
'price_unit': cls.product_delivery_manual3.list_price,
|
||||
'order_id': cls.sale_order_3.id,
|
||||
})
|
||||
|
||||
|
||||
@@ -36,20 +36,14 @@ class TestProjectBilling(TestCommonSaleTimesheet):
|
||||
})
|
||||
|
||||
cls.so1_line_order_no_task = SaleOrderLine.create({
|
||||
'name': cls.product_order_timesheet1.name,
|
||||
'product_id': cls.product_order_timesheet1.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': cls.product_order_timesheet1.uom_id.id,
|
||||
'price_unit': cls.product_order_timesheet1.list_price,
|
||||
'order_id': cls.sale_order_1.id,
|
||||
})
|
||||
|
||||
cls.so1_line_deliver_no_task = SaleOrderLine.create({
|
||||
'name': cls.product_delivery_timesheet1.name,
|
||||
'product_id': cls.product_delivery_timesheet1.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': cls.product_delivery_timesheet1.uom_id.id,
|
||||
'price_unit': cls.product_delivery_timesheet1.list_price,
|
||||
'order_id': cls.sale_order_1.id,
|
||||
})
|
||||
# Sale Order 2, creates 2 project billed at task rate
|
||||
@@ -60,19 +54,13 @@ class TestProjectBilling(TestCommonSaleTimesheet):
|
||||
})
|
||||
cls.so2_line_deliver_project_task = SaleOrderLine.create({
|
||||
'order_id': cls.sale_order_2.id,
|
||||
'name': cls.product_delivery_timesheet3.name,
|
||||
'product_id': cls.product_delivery_timesheet3.id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': cls.product_delivery_timesheet3.uom_id.id,
|
||||
'price_unit': cls.product_delivery_timesheet3.list_price
|
||||
})
|
||||
cls.so2_line_deliver_project_template = SaleOrderLine.create({
|
||||
'order_id': cls.sale_order_2.id,
|
||||
'name': cls.product_delivery_timesheet5.name,
|
||||
'product_id': cls.product_delivery_timesheet5.id,
|
||||
'product_uom_qty': 7,
|
||||
'product_uom': cls.product_delivery_timesheet5.uom_id.id,
|
||||
'price_unit': cls.product_delivery_timesheet5.list_price
|
||||
})
|
||||
cls.sale_order_2.action_confirm()
|
||||
|
||||
|
||||
@@ -54,19 +54,13 @@ class TestReInvoice(TestCommonSaleTimesheet):
|
||||
""" Test vendor bill at cost for product based on ordered and delivered quantities. """
|
||||
# create SO line and confirm SO (with only one line)
|
||||
sale_order_line1 = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_order_cost'].name,
|
||||
'product_id': self.company_data['product_order_cost'].id,
|
||||
'product_uom_qty': 2,
|
||||
'product_uom': self.company_data['product_order_cost'].uom_id.id,
|
||||
'price_unit': self.company_data['product_order_cost'].list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
sale_order_line2 = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_delivery_cost'].name,
|
||||
'product_id': self.company_data['product_delivery_cost'].id,
|
||||
'product_uom_qty': 4,
|
||||
'product_uom': self.company_data['product_delivery_cost'].uom_id.id,
|
||||
'price_unit': self.company_data['product_delivery_cost'].list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
|
||||
@@ -152,21 +146,15 @@ class TestReInvoice(TestCommonSaleTimesheet):
|
||||
"""
|
||||
# create SO line and confirm SO (with only one line)
|
||||
sale_order_line1 = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_delivery_sales_price'].name,
|
||||
'product_id': self.company_data['product_delivery_sales_price'].id,
|
||||
'product_uom_qty': 2,
|
||||
'qty_delivered': 1,
|
||||
'product_uom': self.company_data['product_delivery_sales_price'].uom_id.id,
|
||||
'price_unit': self.company_data['product_delivery_sales_price'].list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
sale_order_line2 = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_order_sales_price'].name,
|
||||
'product_id': self.company_data['product_order_sales_price'].id,
|
||||
'product_uom_qty': 3,
|
||||
'qty_delivered': 1,
|
||||
'product_uom': self.company_data['product_order_sales_price'].uom_id.id,
|
||||
'price_unit': self.company_data['product_order_sales_price'].list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
self.sale_order.action_confirm()
|
||||
@@ -245,12 +233,9 @@ class TestReInvoice(TestCommonSaleTimesheet):
|
||||
""" Test invoicing vendor bill with no policy. Check nothing happen. """
|
||||
# confirm SO
|
||||
sale_order_line = self.env['sale.order.line'].create({
|
||||
'name': self.company_data['product_order_no'].name,
|
||||
'product_id': self.company_data['product_order_no'].id,
|
||||
'product_uom_qty': 2,
|
||||
'qty_delivered': 1,
|
||||
'product_uom': self.company_data['product_order_no'].uom_id.id,
|
||||
'price_unit': self.company_data['product_order_no'].list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
self.sale_order.action_confirm()
|
||||
|
||||
@@ -420,11 +420,8 @@ class TestReporting(TestCommonReporting):
|
||||
|
||||
# simulate the auto creation of the SO line for expense, like we confirm a vendor bill.
|
||||
so_line_expense = self.env['sale.order.line'].create({
|
||||
'name': self.product_expense.name,
|
||||
'product_id': self.product_expense.id,
|
||||
'product_uom_qty': 0.0,
|
||||
'product_uom': self.product_expense.uom_id.id,
|
||||
'price_unit': self.product_expense.list_price, # reinvoice at sales price
|
||||
'order_id': self.sale_order_1.id,
|
||||
'is_expense': True,
|
||||
})
|
||||
@@ -575,11 +572,8 @@ class TestReporting(TestCommonReporting):
|
||||
|
||||
# simulate the auto creation of the SO line for expense, like we confirm a vendor bill.
|
||||
so_line_expense = self.env['sale.order.line'].create({
|
||||
'name': self.product_expense.name,
|
||||
'product_id': self.product_expense.id,
|
||||
'product_uom_qty': 0.0,
|
||||
'product_uom': self.product_expense.uom_id.id,
|
||||
'price_unit': self.product_expense.list_price, # reinvoice at sales price
|
||||
'order_id': self.sale_order_2.id,
|
||||
'is_expense': True,
|
||||
})
|
||||
@@ -701,11 +695,8 @@ class TestReporting(TestCommonReporting):
|
||||
currency = self.env.company.currency_id
|
||||
rounding = currency.rounding
|
||||
so_line_deliver_no_task = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_manual1.name,
|
||||
'product_id': self.product_delivery_manual1.id,
|
||||
'product_uom_qty': 50,
|
||||
'product_uom': self.product_delivery_manual1.uom_id.id,
|
||||
'price_unit': self.product_delivery_manual1.list_price,
|
||||
'order_id': self.sale_order_2.id,
|
||||
})
|
||||
so_line_deliver_no_task.write({'qty_delivered': 1.0})
|
||||
|
||||
@@ -27,8 +27,6 @@ class TestSaleService(TestCommonSaleTimesheet):
|
||||
'name': self.product_delivery_timesheet2.name,
|
||||
'product_id': self.product_delivery_timesheet2.id,
|
||||
'product_uom_qty': 50,
|
||||
'product_uom': self.product_delivery_timesheet2.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet2.list_price
|
||||
})
|
||||
|
||||
self.sale_order.order_line._compute_product_updatable()
|
||||
@@ -79,11 +77,8 @@ class TestSaleService(TestCommonSaleTimesheet):
|
||||
})
|
||||
|
||||
self.env['sale.order.line'].create({
|
||||
'name': product_service_task.name,
|
||||
'product_id': product_service_task.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': product_service_task.uom_id.id,
|
||||
'price_unit': product_service_task.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
|
||||
@@ -102,11 +97,9 @@ class TestSaleService(TestCommonSaleTimesheet):
|
||||
uom_days = self.env.ref('uom.product_uom_day')
|
||||
sale_order_line = self.env['sale.order.line'].create({
|
||||
'order_id': self.sale_order.id,
|
||||
'name': self.product_delivery_timesheet3.name,
|
||||
'product_id': self.product_delivery_timesheet3.id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': uom_days.id,
|
||||
'price_unit': self.product_delivery_timesheet3.list_price
|
||||
})
|
||||
self.sale_order.action_confirm()
|
||||
task = self.env['project.task'].search([('sale_line_id', '=', sale_order_line.id)])
|
||||
@@ -134,11 +127,8 @@ class TestSaleService(TestCommonSaleTimesheet):
|
||||
def test_task_so_line_assignation(self):
|
||||
# create SO line and confirm it
|
||||
so_line_deliver_global_project = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet2.name,
|
||||
'product_id': self.product_delivery_timesheet2.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': self.product_delivery_timesheet2.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet2.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
self.sale_order.action_confirm()
|
||||
@@ -179,11 +169,8 @@ class TestSaleService(TestCommonSaleTimesheet):
|
||||
def test_delivered_quantity(self):
|
||||
# create SO line and confirm it
|
||||
so_line_deliver_new_task_project = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet3.name,
|
||||
'product_id': self.product_delivery_timesheet3.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': self.product_delivery_timesheet3.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet3.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
self.sale_order.action_confirm()
|
||||
@@ -229,11 +216,8 @@ class TestSaleService(TestCommonSaleTimesheet):
|
||||
the ordered quantity of a SO line that have created a task should update the planned hours of this task.
|
||||
"""
|
||||
so_line1 = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet3.name,
|
||||
'product_id': self.product_delivery_timesheet3.id,
|
||||
'product_uom_qty': 7,
|
||||
'product_uom': self.product_delivery_timesheet3.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet3.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
|
||||
@@ -316,43 +300,28 @@ class TestSaleService(TestCommonSaleTimesheet):
|
||||
|
||||
# create 5 so lines
|
||||
so_line1 = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet5.name,
|
||||
'product_id': self.product_delivery_timesheet5.id,
|
||||
'product_uom_qty': 11,
|
||||
'product_uom': self.product_delivery_timesheet5.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet5.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
so_line2 = self.env['sale.order.line'].create({
|
||||
'name': self.product_order_timesheet4.name,
|
||||
'product_id': self.product_order_timesheet4.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': self.product_order_timesheet4.uom_id.id,
|
||||
'price_unit': self.product_order_timesheet4.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
so_line3 = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet5.name,
|
||||
'product_id': self.product_delivery_timesheet5.id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': self.product_delivery_timesheet5.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet5.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
so_line4 = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_manual3.name,
|
||||
'product_id': self.product_delivery_manual3.id,
|
||||
'product_uom_qty': 4,
|
||||
'product_uom': self.product_delivery_manual3.uom_id.id,
|
||||
'price_unit': self.product_delivery_manual3.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
so_line5 = self.env['sale.order.line'].create({
|
||||
'name': product_deli_ts_tmpl.name,
|
||||
'product_id': product_deli_ts_tmpl.id,
|
||||
'product_uom_qty': 8,
|
||||
'product_uom': product_deli_ts_tmpl.uom_id.id,
|
||||
'price_unit': product_deli_ts_tmpl.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
|
||||
@@ -410,27 +379,18 @@ class TestSaleService(TestCommonSaleTimesheet):
|
||||
self.assertEqual(self.sale_order.analytic_account_id, self.analytic_account_sale, "Changing the project on the SO should set the analytic account accordingly.")
|
||||
|
||||
so_line1 = self.env['sale.order.line'].create({
|
||||
'name': self.product_order_timesheet3.name,
|
||||
'product_id': self.product_order_timesheet3.id,
|
||||
'product_uom_qty': 11,
|
||||
'product_uom': self.product_order_timesheet3.uom_id.id,
|
||||
'price_unit': self.product_order_timesheet3.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
so_line2 = self.env['sale.order.line'].create({
|
||||
'name': self.product_order_timesheet3.name,
|
||||
'product_id': self.product_order_timesheet3.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': self.product_order_timesheet3.uom_id.id,
|
||||
'price_unit': self.product_order_timesheet3.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
so_line3 = self.env['sale.order.line'].create({
|
||||
'name': self.product_order_timesheet4.name,
|
||||
'product_id': self.product_order_timesheet4.id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': self.product_order_timesheet4.uom_id.id,
|
||||
'price_unit': self.product_order_timesheet4.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
|
||||
@@ -467,11 +427,8 @@ class TestSaleService(TestCommonSaleTimesheet):
|
||||
"""
|
||||
|
||||
so_line1 = self.env['sale.order.line'].create({
|
||||
'name': self.product_order_timesheet3.name,
|
||||
'product_id': self.product_order_timesheet3.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': self.product_order_timesheet3.uom_id.id,
|
||||
'price_unit': self.product_order_timesheet3.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
|
||||
@@ -493,19 +450,14 @@ class TestSaleService(TestCommonSaleTimesheet):
|
||||
""" Test if subtasks and tasks are billed on the correct SO line """
|
||||
# create SO line and confirm it
|
||||
so_line_deliver_new_task_project = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet3.name,
|
||||
'product_id': self.product_delivery_timesheet3.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': self.product_delivery_timesheet3.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet3.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
so_line_deliver_new_task_project_2 = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet3.name + "(2)",
|
||||
'product_id': self.product_delivery_timesheet3.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': self.product_delivery_timesheet3.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet3.list_price,
|
||||
'order_id': self.sale_order.id,
|
||||
})
|
||||
self.sale_order.action_confirm()
|
||||
@@ -552,11 +504,8 @@ class TestSaleService(TestCommonSaleTimesheet):
|
||||
""" Changing the ordered quantity of a SO line that have created a task should update the planned hours of this task """
|
||||
sale_order_line = self.env['sale.order.line'].create({
|
||||
'order_id': self.sale_order.id,
|
||||
'name': self.product_delivery_timesheet2.name,
|
||||
'product_id': self.product_delivery_timesheet2.id,
|
||||
'product_uom_qty': 50,
|
||||
'product_uom': self.product_delivery_timesheet2.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet2.list_price
|
||||
})
|
||||
|
||||
self.sale_order.action_confirm()
|
||||
@@ -576,11 +525,8 @@ class TestSaleService(TestCommonSaleTimesheet):
|
||||
def test_copy_billable_project_and_task(self):
|
||||
sale_order_line = self.env['sale.order.line'].create({
|
||||
'order_id': self.sale_order.id,
|
||||
'name': self.product_delivery_timesheet3.name,
|
||||
'product_id': self.product_delivery_timesheet3.id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': self.product_delivery_timesheet3.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet3.list_price
|
||||
})
|
||||
self.sale_order.action_confirm()
|
||||
task = self.env['project.task'].search([('sale_line_id', '=', sale_order_line.id)])
|
||||
|
||||
@@ -35,19 +35,13 @@ class TestSaleTimesheet(TestCommonSaleTimesheet):
|
||||
'pricelist_id': self.company_data['default_pricelist'].id,
|
||||
})
|
||||
so_line_ordered_project_only = self.env['sale.order.line'].create({
|
||||
'name': self.product_order_timesheet4.name,
|
||||
'product_id': self.product_order_timesheet4.id,
|
||||
'product_uom_qty': 10,
|
||||
'product_uom': self.product_order_timesheet4.uom_id.id,
|
||||
'price_unit': self.product_order_timesheet4.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
so_line_ordered_global_project = self.env['sale.order.line'].create({
|
||||
'name': self.product_order_timesheet2.name,
|
||||
'product_id': self.product_order_timesheet2.id,
|
||||
'product_uom_qty': 50,
|
||||
'product_uom': self.product_order_timesheet2.uom_id.id,
|
||||
'price_unit': self.product_order_timesheet2.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
sale_order.action_confirm()
|
||||
@@ -109,11 +103,8 @@ class TestSaleTimesheet(TestCommonSaleTimesheet):
|
||||
|
||||
# add so line with produdct "create task in new project".
|
||||
so_line_ordered_task_in_project = self.env['sale.order.line'].create({
|
||||
'name': self.product_order_timesheet3.name,
|
||||
'product_id': self.product_order_timesheet3.id,
|
||||
'product_uom_qty': 3,
|
||||
'product_uom': self.product_order_timesheet3.uom_id.id,
|
||||
'price_unit': self.product_order_timesheet3.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
|
||||
@@ -171,19 +162,13 @@ class TestSaleTimesheet(TestCommonSaleTimesheet):
|
||||
'pricelist_id': self.company_data['default_pricelist'].id,
|
||||
})
|
||||
so_line_deliver_global_project = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet2.name,
|
||||
'product_id': self.product_delivery_timesheet2.id,
|
||||
'product_uom_qty': 50,
|
||||
'product_uom': self.product_delivery_timesheet2.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet2.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
so_line_deliver_task_project = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet3.name,
|
||||
'product_id': self.product_delivery_timesheet3.id,
|
||||
'product_uom_qty': 20,
|
||||
'product_uom': self.product_delivery_timesheet3.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet3.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
|
||||
@@ -248,11 +233,8 @@ class TestSaleTimesheet(TestCommonSaleTimesheet):
|
||||
|
||||
# add a line on SO
|
||||
so_line_deliver_only_project = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet4.name,
|
||||
'product_id': self.product_delivery_timesheet4.id,
|
||||
'product_uom_qty': 5,
|
||||
'product_uom': self.product_delivery_timesheet4.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet4.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
self.assertEqual(len(sale_order.project_ids), 2, "No new project should have been created by the SO, when selling 'project only' product, since it reuse the one from 'new task in new project'.")
|
||||
@@ -303,19 +285,13 @@ class TestSaleTimesheet(TestCommonSaleTimesheet):
|
||||
'pricelist_id': self.company_data['default_pricelist'].id,
|
||||
})
|
||||
so_line_manual_global_project = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_manual2.name,
|
||||
'product_id': self.product_delivery_manual2.id,
|
||||
'product_uom_qty': 50,
|
||||
'product_uom': self.product_delivery_manual2.uom_id.id,
|
||||
'price_unit': self.product_delivery_manual2.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
so_line_manual_only_project = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_manual4.name,
|
||||
'product_id': self.product_delivery_manual4.id,
|
||||
'product_uom_qty': 20,
|
||||
'product_uom': self.product_delivery_manual4.uom_id.id,
|
||||
'price_unit': self.product_delivery_manual4.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
|
||||
@@ -396,19 +372,13 @@ class TestSaleTimesheet(TestCommonSaleTimesheet):
|
||||
'display_type': 'line_section',
|
||||
})
|
||||
so_line_deliver_global_project = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet2.name,
|
||||
'product_id': self.product_delivery_timesheet2.id,
|
||||
'product_uom_qty': 50,
|
||||
'product_uom': self.product_delivery_timesheet2.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet2.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
so_line_deliver_task_project = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet3.name,
|
||||
'product_id': self.product_delivery_timesheet3.id,
|
||||
'product_uom_qty': 20,
|
||||
'product_uom': self.product_delivery_timesheet3.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet3.list_price,
|
||||
'order_id': sale_order.id,
|
||||
})
|
||||
|
||||
@@ -603,19 +573,13 @@ class TestSaleTimesheet(TestCommonSaleTimesheet):
|
||||
'pricelist_id': self.company_data['default_pricelist'].id,
|
||||
})
|
||||
so1_product_global_project_so_line = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet2.name,
|
||||
'product_id': self.product_delivery_timesheet2.id,
|
||||
'product_uom_qty': 50,
|
||||
'product_uom': self.product_delivery_timesheet2.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet2.list_price,
|
||||
'order_id': sale_order1.id,
|
||||
})
|
||||
so2_product_global_project_so_line = self.env['sale.order.line'].create({
|
||||
'name': self.product_delivery_timesheet2.name,
|
||||
'product_id': self.product_delivery_timesheet2.id,
|
||||
'product_uom_qty': 20,
|
||||
'product_uom': self.product_delivery_timesheet2.uom_id.id,
|
||||
'price_unit': self.product_delivery_timesheet2.list_price,
|
||||
'order_id': sale_order2.id,
|
||||
})
|
||||
|
||||
@@ -674,11 +638,8 @@ class TestSaleTimesheet(TestCommonSaleTimesheet):
|
||||
uom_days = self.env.ref('uom.product_uom_day')
|
||||
sale_order_line = self.env['sale.order.line'].create({
|
||||
'order_id': sale_order.id,
|
||||
'name': self.product_order_timesheet3.name,
|
||||
'product_id': self.product_order_timesheet3.id,
|
||||
'product_uom_qty': 1,
|
||||
'product_uom': uom_days.id,
|
||||
'price_unit': self.product_order_timesheet3.list_price,
|
||||
})
|
||||
sale_order.action_confirm()
|
||||
task = sale_order_line.task_id
|
||||
|
||||
@@ -37,10 +37,8 @@ class TestUpsellWarning(TestCommonSaleTimesheet):
|
||||
|
||||
self.env['sale.order.line'].create({
|
||||
'order_id': so.id,
|
||||
'name': self.product_order_timesheet1.name,
|
||||
'product_id': self.product_order_timesheet1.id,
|
||||
'product_uom_qty': 10,
|
||||
'price_unit': self.product_order_timesheet1.list_price,
|
||||
})
|
||||
so.action_confirm()
|
||||
|
||||
|
||||
@@ -55,10 +55,8 @@ class TestDropship(common.TransactionCase):
|
||||
# Create a new so line
|
||||
sol2 = self.env['sale.order.line'].create({
|
||||
'order_id': so.id,
|
||||
'name': prod.name,
|
||||
'product_id': prod.id,
|
||||
'product_uom_qty': 3.00,
|
||||
'product_uom': prod.uom_id.id,
|
||||
'price_unit': 12,
|
||||
})
|
||||
# there is a new line
|
||||
|
||||
@@ -174,11 +174,7 @@ class TestWebsiteSaleProductPricelist(TestSaleProductAttributeValueCommon):
|
||||
'partner_id': self.env.user.partner_id.id,
|
||||
})
|
||||
sol = self.env['sale.order.line'].create({
|
||||
'name': test_product.name,
|
||||
'product_id': test_product.product_variant_id.id,
|
||||
'product_uom_qty': 1,
|
||||
'product_uom': test_product.uom_id.id,
|
||||
'price_unit': test_product.list_price,
|
||||
'order_id': so.id,
|
||||
'tax_id': [(6, 0, [tax10.id])],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user