Skip to content

Commit

Permalink
[ADD][br_deliverable] move the estimation pricelist from the project …
Browse files Browse the repository at this point in the history
…to the customer (OCA#117)

* [IMP] business_requirement_deliverable
Improve customer model to add additional pricelist for estimations

* Update README.rst

* Bumped version number

* [ADD] business_requirement_deliverable
Propery on new API is mean company dependent

* [ADD] business_requirement_deliverable
Add company dependent (property) pricelist for estimation

* Refreshed the README

* Removed the single quotes
  • Loading branch information
Victor Martin - Elico Corp authored and bizzappdev committed Mar 4, 2023
1 parent 4b4b1a8 commit 4892862
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 11 deletions.
41 changes: 31 additions & 10 deletions business_requirement_deliverable/README.rst
Expand Up @@ -16,6 +16,9 @@ Two new concepts complement the main business requirements model:
* Deliverable lines
* Resource lines

A field for pricelist estimation is available in the partner to be used in Deliverable
and Resources lines valuation to customers.

What is a Deliverable Line?
---------------------------

Expand Down Expand Up @@ -43,8 +46,7 @@ Resources Lines (RL) are the different tasks or procurements needed to achieve o
* Procurement of other physical goods (server, etc.)
* Procurement of other virtual goods (templates, sub-contracting, etc.)

RL directly depends on the DL.

RL depends on the DL or directly on BR

.. figure:: ../business_requirement_deliverable/static/img/bus_req_resource.png
:width: 600 px
Expand Down Expand Up @@ -102,24 +104,39 @@ Configuration
Users
-----

No specific ACL are required for the module.
Estimation Pricelist: user can see the Sales price and revenue of the BR.

Master project
--------------

You can define a master project linked to the business requirement.
You can define a master project linked to the business requirement. Default Customer
from the project will be used to populate the BR. The customer can be changed if necessary.

Valuation of the Deliverable and Resources lines
------------------------------------------------
When writing a BR the user has the possibility to add Deliverable and Resources lines.
To value the Deliverable lines, you can specify an estimation price list in the customer,
which will be used in 2 main places:

You have to specify a estimation price list in the master project, used for
deliverable price management. If no pricelist is specified in the project,
the one from the customer associated will be used.
* In Deliverable lines if the deliverable product is in pricelist
* In Resource lines if you want to value your deliverable from the resources

NB: Here is the way Odoo will get a price in Deliverable and Resources Lines:

#. If the Estimation Pricelist field is not empty use the Estimation pricelist
#. If empty, use the standard customer pricelist field
#. If no pricelist available (for example no customer defined in the project), use
the product Sales price.


Usage
=====

#. In the BR, you can add as many deliverable lines as necessary. Price of the deliverable lines will depend on the pricelist in master project or customer.
#. In the BR, you can add as many deliverable lines as necessary. Price of the deliverable
lines will depend on the pricelist(s) in customer.

#. Once the deliverable lines are created you can create as many resources lines as necessary in each DL. Cost price of the product will apply
#. Once the deliverable lines are created you can create as many resources lines as necessary
in each DL. Cost price of the product will apply

#. in RL you can already assign the responsible of the task if necessary

Expand All @@ -132,14 +149,18 @@ Usage
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/222/8.0


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.

Known issues / Roadmap
======================
* As of version 8.0.5.0.0, the estimation pricelist has been moved from Project to
Partner object. There is no migration script for the change and the data will
have to be migrated manually.
Credits
=======

Expand Down
3 changes: 2 additions & 1 deletion business_requirement_deliverable/__openerp__.py
Expand Up @@ -6,7 +6,7 @@
'category': 'Business Requirements Management',
'summary': 'Manage the Business Requirement Deliverables and \
Resources for your customers',
'version': '8.0.4.0.0',
'version': '8.0.5.0.0',
'website': 'https://www.elico-corp.com/',
"author": "Elico Corp, Odoo Community Association (OCA)",
'depends': [
Expand All @@ -17,6 +17,7 @@
'security/business_requirement_deliverable_security.xml',
'security/ir.model.access.csv',
'views/business_view.xml',
'views/res_partner.xml',
'report/br_deliverable_report_view.xml',
'report/br_deliverable_sale_report_view.xml',
],
Expand Down
2 changes: 2 additions & 0 deletions business_requirement_deliverable/models/__init__.py
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
# © 2016 Elico Corp (https://www.elico-corp.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import business
from . import res_partner
26 changes: 26 additions & 0 deletions business_requirement_deliverable/models/res_partner.py
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# © 2016 Elico Corp (https://www.elico-corp.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models


class ResPartner(models.Model):
_inherit = 'res.partner'

property_product_estimation_pricelist = fields.Many2one(
string='Estimation Pricelist',
comodel_name='product.pricelist',
company_dependent=True,
help="""Pricelist used for the estimation of the Business Requirements
Deliverables linked to this Customer.
Currency of the Deliverables will be the one from the pricelist.""")

def _commercial_fields(self, cr, uid, context=None):
return super(
ResPartner,
self
)._commercial_fields(
cr,
uid,
context=context
) + ['property_product_estimation_pricelist']
18 changes: 18 additions & 0 deletions business_requirement_deliverable/views/res_partner.xml
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>

<openerp>
<data>

<record id="view_partner_property_form" model="ir.ui.view">
<field name="name">res.partner.product.property.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="product.view_partner_property_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='property_product_pricelist']" position="after">
<field name="property_product_estimation_pricelist" groups="product.group_sale_pricelist"/>
</xpath>
</field>
</record>

</data>
</openerp>

0 comments on commit 4892862

Please sign in to comment.