Files
odoo_source/addons/sale_purchase/tests/common.py
T
Bonis ModiandKartik Chavda f4c054e473 [IMP] project, hr_timesheet, *: improve generic ux
Purpose of this commit to improve generic UX for the project app.

So, In this commit done following changes:

- add 'subtask_effective_hours' and 'total_hours_spent' fields in the page of
subtask in task form view.
- change invisible attrs to column_invisible attrs for block_by page in task
form view.
- add 'task in progress' subtype for project.task and move 'stage changed'
subtype above 'task blocked'.
- remove the 'is_close' field and all its references from project.task.type.
- unarchive all of its tasks when the user unarchives the task stage.
- sort projects on 'is_favorite'.
- internal users following the project automatically follow its updates and
their notification preferences propagated accordingly.
- duplicating a task will duplicate all of its subtasks.
- move parent task field in extra info page of task form view.
- change the label of 'edit' to 'view' in the burger menu of project kanban view.
- user can delete task without sale_order validation error.
- add constraints for 'seller_ids' field.
- add remaining_hours_so field in task tree view.
- add unusual_days in task calendar view.
- add 'no content helper' in action of burndown chart.

task-2536044

closes odoo/odoo#74018

Related: odoo/enterprise#19880
Related: odoo/upgrade#2801
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Co-authored-by: Kartik Chavda <kcv@odoo.com>
2021-11-23 12:04:00 +00:00

75 lines
2.9 KiB
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.sale.tests.common import TestSaleCommon
from odoo import Command
class TestCommonSalePurchaseNoChart(TestSaleCommon):
@classmethod
def setUpClass(cls, chart_template_ref=None):
super().setUpClass(chart_template_ref=chart_template_ref)
uom_unit = cls.env.ref('uom.product_uom_unit')
uom_dozen = cls.env.ref('uom.product_uom_dozen')
# Create category
cls.product_category_purchase = cls.env['product.category'].create({
'name': 'Product Category with Income account',
'property_account_income_categ_id': cls.company_data['default_account_expense'].id
})
cls.partner_vendor_service = cls.env['res.partner'].create({
'name': 'Super Service Supplier',
'email': 'supplier.serv@supercompany.com',
})
cls.supplierinfo1 = cls.env['product.supplierinfo'].create({
'partner_id': cls.partner_vendor_service.id,
'price': 100,
'delay': 1,
})
cls.supplierinfo2 = cls.env['product.supplierinfo'].create({
'partner_id': cls.partner_vendor_service.id,
'price': 10,
'delay': 5,
})
# Create product
# When service_to_purser is True add the supplier i.e 'saller_ids' on the product to void the Validation error at product creation time
cls.service_purchase_1 = cls.env['product.product'].create({
'name': "Out-sourced Service 1",
'standard_price': 200.0,
'list_price': 180.0,
'type': 'service',
'uom_id': uom_unit.id,
'uom_po_id': uom_unit.id,
'invoice_policy': 'delivery',
'expense_policy': 'no',
'default_code': 'SERV_DEL',
'service_type': 'manual',
'taxes_id': False,
'categ_id': cls.product_category_purchase.id,
'service_to_purchase': True,
'seller_ids': [Command.set(cls.supplierinfo1.ids)],
})
cls.service_purchase_2 = cls.env['product.product'].create({
'name': "Out-sourced Service 2",
'standard_price': 20.0,
'list_price': 15.0,
'type': 'service',
'uom_id': uom_dozen.id, # different UoM
'uom_po_id': uom_unit.id,
'invoice_policy': 'order',
'expense_policy': 'no',
'default_code': 'SERV_ORD',
'service_type': 'manual',
'taxes_id': False,
'categ_id': cls.product_category_purchase.id,
'service_to_purchase': True,
'seller_ids': [Command.set(cls.supplierinfo2.ids)],
})
cls.supplierinfo1.product_tmpl_id = cls.service_purchase_1.product_tmpl_id.id
cls.supplierinfo2.product_tmpl_id = cls.service_purchase_2.product_tmpl_id.id