Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] business_requirement: Migration to v12 #315

Merged
merged 44 commits into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b9e6feb
[ADD] business_requirement
Jun 2, 2016
804a68f
Reduced outside margin of the icon
Jun 10, 2016
5d8196f
[FIX] business_requirement:
Jun 13, 2016
28c3dc7
added the module in the image path in README
Jun 16, 2016
fdddcc2
[IMP] business_requirement: Adapt current workflow.
Jun 20, 2016
4d74971
Update README to correct runbot address + figure (#12)
elicoidal Aug 18, 2016
966e478
[IMP] business_requirement: Improvement on master project related to …
Sep 9, 2016
f5e93c2
Improve the README and added functional workflow (#18)
elicoidal Sep 13, 2016
ccbd971
[IMP]business_requirement: add test case field (#28)
RawEvan Sep 30, 2016
d6aeee0
[8.0] Fix Duplicate Function for Business Requirements
astirpe Oct 4, 2016
e8acc62
[FIX] fix the business_requirement message body empty issue
noahzaozao Jan 19, 2017
0b37c54
[FIX] business_requirement
Feb 14, 2017
75b9390
[UPD] fix website url in manifest
sbidoul Mar 12, 2017
4575f62
[IMP] followers of master project to BR
YogeshMahera-SerpentCS Mar 23, 2017
77aca08
[8.0][FIX] Wizard to generate the project (#42)
kl-adonze Mar 25, 2017
8a35d5a
[FIX] Fixed travis
serpentcs-dev1 Mar 30, 2017
deeda49
[IMP][MIG] business_requirement (#112)
Apr 14, 2017
079088e
[8.0][IMP] Transfer the Gross Profit fields to the Deliverable lines …
sudhir-serpentcs Apr 28, 2017
2a1d4cf
OCA Transbot updated translations from Transifex
oca-transbot May 1, 2017
751c801
[FIX]144 In stages missing the stage drop (#165)
serpentcs-dev1 May 30, 2017
3881d60
[FIX][8.0-i181-BR001028-T22316] BR ordering on Tree view (#201)
sudhir-serpentcs Jul 5, 2017
da0f607
[8.0]-[BR1030]-[ADD/IMP][Reference field improvements] (#208)
serpentcs-dev1 Jul 10, 2017
d242898
[Issue-197][IMP]Improved String (#214)
YogeshMahera-SerpentCS Jul 12, 2017
beb2390
[IMP] [8.0-i195-BR001028-T22321] Added code to search BR based on Na…
sudhir-serpentcs Jul 17, 2017
42092f0
[IMP][8.0][22070][ISSUE#115]-Modify projects and BR id relationship (…
serpentcs-dev1 Jul 24, 2017
2c0de1b
[8.0][I-215][BR1030]-Set Default Values (#219)
YogeshMahera-SerpentCS Jul 24, 2017
f02ced4
[WIP][8.0][BR001024] - Added demo data for BR modules (#212)
serpentcs-dev1 Jul 27, 2017
da0e133
[8.0][IMP]-Improved Origin field (#226)
YogeshMahera-SerpentCS Aug 4, 2017
5fa6637
init branch 9.0
elicoidal Jul 25, 2017
b97c009
[MIG]Migrated Business requirement module from 8.0 to 10.0 (#223)
YogeshMahera-SerpentCS Aug 15, 2017
8127594
Kanban view move from BRP to BR (#243)
sudhir-serpentcs Sep 11, 2017
1f03813
[MIG]-Migrated Business requirement deliverable cost module from 8.0 …
YogeshMahera-SerpentCS Sep 30, 2017
e85cfa0
[IMP] [10.0] BR001208-T24350: Add field "Terms and Conditions" (#266)
Nov 22, 2017
94b8c95
[fix][modify][i3991] unread message filter (#277)
Reinhard-sheng Mar 2, 2018
0720111
Added set up section
Apr 29, 2018
7360264
[MIG] migration business_requirement_resource_template categ_id from …
joycehuan Sep 3, 2018
a636a52
[UPD] Update business_requirement.pot
oca-travis Sep 3, 2018
15375ce
[ADD]business_requirement_earned_value (#278)
Sep 13, 2018
4fb32ce
Added translation using Weblate (French)
Yakulu Dec 22, 2018
57f8efc
[MIG] business_requirement: Migration to 11.0
Jun 4, 2019
fcffd99
[IMP] business_requirement: Add Report + Portal
Tardo Jun 6, 2019
1d00d69
[REM] Master project and WBS
Jun 10, 2019
194556c
[IMP] business_requirement: Icon
pedrobaeza Jun 21, 2019
a525304
[MIG] business_requirement: Migration to v12
Jun 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
125 changes: 125 additions & 0 deletions business_requirement/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
====================
Business Requirement
====================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fbusiness--requirement-lightgray.png?logo=github
:target: https://github.com/OCA/business-requirement/tree/12.0/business_requirement
:alt: OCA/business-requirement
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/business-requirement-12-0/business-requirement-12-0-business_requirement
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/222/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

A **Business requirement** (BR) is the expression of a business need by a customer
or internal project user.

A BR contains multiple different parts to explain the stakeholder need and how to
meet his/her requirements:

* **Customer Story**: this is the requirement as expressed by the customer
* **Scenario**: How/where the current solution can provide a suitable scenario to
answer the customer story
* **Gap**: For the uncovered part of the scenario, elaborate the gap/need for specific
developments/setup
* **Test case**: A set of conditions under which a tester will determine whether the application, software system or
one of its features is working as it was originally established for it to do.
* **Deliverables** to be provided to the customer/user
* **Resources** necessary to achieve the deliverables
* **Additional** information (approval, cost control etc.)

This set of modules was originally designed for the service/IT industry but the
requirement management design has been kept as generic as possible so that it can
apply to many other cases/industries (customer or internal projects):

* Construction
* Trading (New product development)
* Business Consultancy
* Web or IT development
* R&D projects
* etc.

More information about business requirements management:

* `Wikipedia <https://en.wikipedia.org/wiki/Business_requirements>`_
* `Six Sigma <https://www.isixsigma.com/implementation/project-selection-tracking/business-requirements-document-high-level-review/>`_

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/business-requirement/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/business-requirement/issues/new?body=module:%20business_requirement%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Elico Corp
* Tecnativa

Contributors
~~~~~~~~~~~~

* Eric Caudal <eric.caudal@elico-corp.com>
* Alex Duan <alex.duan@elico-corp.com>
* Xie XiaoPeng <xie.xiaopeng@elico-corp.com>
* Victor M. Martin <victor.martin@elico-corp.com>
* Evan Li <li.aiwen@elico-corp.com>
* Reinhard Sheng <reinhard.sheng@elico-corp.com>

* `Tecnativa <https://www.tecnativa.com>`_:

* Alexandre Diaz
* Pedro M. Baeza
* Victor M.M. Torres

Other credits
~~~~~~~~~~~~~


* Images:

* `briefcase <https://fontawesome.com/icons/briefcase?style=solid>`__ from `FontAwesome <https://fontawesome.com/license>`__.
* `drafting-compass <https://fontawesome.com/icons/drafting-compass?style=solid>`__ from `FontAwesome <https://fontawesome.com/license>`__.

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/business-requirement <https://github.com/OCA/business-requirement/tree/12.0/business_requirement>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions business_requirement/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2017-2019 Elico Corp (https://www.elico-corp.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
from . import tests
from . import controllers
45 changes: 45 additions & 0 deletions business_requirement/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2017-2019 Elico Corp (https://www.elico-corp.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Business Requirement",
"category": "Business Requirements Management",
"summary": "Manage the Business Requirements (stories, scenarios, gaps\
and test cases) for your customers",
"version": "12.0.1.0.0",
"website": "https://github.com/OCA/business-requirement",
"author": "Elico Corp, "
"Tecnativa, "
"Odoo Community Association (OCA)",
victormmtorres marked this conversation as resolved.
Show resolved Hide resolved
"depends": [
"product",
"portal",
],
"data": [
"data/business_data.xml",
"security/security.xml",
"security/ir.model.access.csv",
"views/business_view.xml",
"views/br_report.xml",
"views/br_portal_templates.xml",
"report/report.xml"
],
"image": [
"static/description/icon.png",
"static/img/bus_req.png",
"static/img/bus_req_alias.png",
"static/img/bus_req_approved.png",
"static/img/bus_req_cancel.png",
"static/img/bus_req_confirmed.png",
"static/img/bus_req_cust_story.png",
"static/img/bus_req_done.png",
"static/img/bus_req_drop.png",
"static/img/bus_req_tags.png",
"static/img/bus_req_tags2.png",
"static/img/bus_req_tree.png",
"static/img/bus_req_workflow.png"
],
"demo": ["data/business_requirement_demo.xml"],
"license": "AGPL-3",
"installable": True,
"application": True,
}
1 change: 1 addition & 0 deletions business_requirement/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import portal
149 changes: 149 additions & 0 deletions business_requirement/controllers/portal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Copyright 2019 Tecnativa - Alexandre Díaz
from odoo import http, _
from odoo.exceptions import AccessError
from odoo.http import request
from odoo.tools import consteq
from odoo.addons.portal.controllers.portal import (
CustomerPortal,
pager as portal_pager, get_records_pager)


class CustomerPortal(CustomerPortal):

def _prepare_portal_layout_values(self):
values = super()._prepare_portal_layout_values()
br_count = request.env['business.requirement'].search_count(
self._prepare_br_base_domain())
values.update({
'business_requirement_count': br_count,
})
return values

def _prepare_br_base_domain(self):
partner = request.env.user.partner_id
return [
('message_partner_ids', 'child_of', [
partner.commercial_partner_id.id]),
('portal_published', '=', True)
]

def _br_check_access(self, br_id, access_token=None):
br = request.env['business.requirement'].browse([br_id])
br_sudo = br.sudo()
try:
br.check_access_rights('read')
br.check_access_rule('read')
except AccessError:
if not access_token or not consteq(br_sudo.access_token,
access_token):
raise
return br_sudo

def _br_get_page_view_values(self, br, access_token, **kwargs):
values = {
'business_requirement': br,
'page_name': 'business_requirement',
}
if access_token:
values['no_breadcrumbs'] = True
values['access_token'] = access_token
values['portal_confirmation'] = br.get_portal_confirmation_action()

if kwargs.get('error'):
values['error'] = kwargs['error']
if kwargs.get('warning'):
values['warning'] = kwargs['warning']
if kwargs.get('success'):
values['success'] = kwargs['success']

history = request.session.get('my_br_history', [])
values.update(get_records_pager(history, br))

return values

@http.route(['/my/business_requirements',
'/my/business_requirements/page/<int:page>'],
type='http', auth="user", website=True)
def portal_my_br(self, page=1, date_begin=None, date_end=None,
sortby=None, **kw):
values = self._prepare_portal_layout_values()
BRObj = request.env['business.requirement']

searchbar_sortings = {
'date': {'label': _('Date'), 'order': 'date desc'},
'sequence': {'label': _('Sequence'), 'order': 'sequence'},
}
# default sortby br
if not sortby:
sortby = 'sequence'
sort_br = searchbar_sortings[sortby]['order']

domain = self._prepare_br_base_domain()

archive_groups = self._get_archive_groups('business.requirement',
domain)
if date_begin and date_end:
domain += [('date', '>', date_begin),
('date', '<=', date_end)]

# count for pager
br_count = BRObj.search_count(domain)
# pager
pager = portal_pager(
url="/my/business_requirements",
url_args={'date_begin': date_begin,
'date_end': date_end,
'sortby': sortby},
total=br_count,
page=page,
step=self._items_per_page
)
# content according to pager and archive selected
business_requirements = BRObj.search(domain, order=sort_br,
limit=self._items_per_page,
offset=pager['offset'])
request.session['my_br_history'] = business_requirements.ids[:100]

values.update({
'date': date_begin,
'business_requirements': business_requirements.sudo(),
'page_name': 'business_requirement',
'pager': pager,
'archive_groups': archive_groups,
'default_url': '/my/business_requirements',
'searchbar_sortings': searchbar_sortings,
'sortby': sortby,
})
return request.render("business_requirement.portal_my_br", values)

@http.route(['/my/business_requirement/<int:br_id>'],
type='http', auth="public", website=True)
def portal_br_page(self, br_id=None, access_token=None, **kw):
try:
br_sudo = self._br_check_access(br_id, access_token=access_token)
except AccessError:
return request.redirect('/my')

values = self._br_get_page_view_values(br_sudo, access_token, **kw)
return request.render("business_requirement.portal_br_page", values)

def _get_br_report_name(self):
return ('business_requirement.'
'business_requirement_report')

@http.route(['/my/business_requirement/pdf/<int:br_id>'],
type='http', auth="public", website=True)
def portal_br_report(self, br_id, access_token=None, **kw):
try:
br_sudo = self._br_check_access(br_id, access_token)
except AccessError:
return request.redirect('/my')

# print report as sudo
pdf = request.env.ref(self._get_br_report_name())\
.sudo().render_qweb_pdf([br_sudo.id])[0]
pdfhttpheaders = [
('Content-Type', 'application/pdf'),
('Content-Length', len(pdf)),
]
return request.make_response(pdf, headers=pdfhttpheaders)
20 changes: 20 additions & 0 deletions business_requirement/data/business_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">

<record id="seq_business_requirement" model="ir.sequence">
<field name="name">Business Requirement</field>
<field name="code">business.requirement</field>
<field name="prefix">BR</field>
<field name="padding">6</field>
<field name="company_id" eval="False"/>
</record>

<record model="ir.module.category" id="module_category_business_requirement">
<field name="name">Business Requirement</field>
<field name="description"></field>
<field name="sequence">9</field>
</record>

</data>
</odoo>