Skip to content

Commit

Permalink
[18.0][MIG] contract
Browse files Browse the repository at this point in the history
  • Loading branch information
sbejaoui committed Nov 4, 2024
1 parent 3506728 commit 6a4d57f
Show file tree
Hide file tree
Showing 18 changed files with 79 additions and 105 deletions.
16 changes: 8 additions & 8 deletions contract/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Recurring - Contracts Management
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github
:target: https://github.com/OCA/contract/tree/17.0/contract
:target: https://github.com/OCA/contract/tree/18.0/contract
:alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-contract
:target: https://translation.odoo-community.org/projects/contract-18-0/contract-18-0-contract
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/contract&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -93,9 +93,9 @@ Usage

|image2|

.. |image| image:: https://raw.githubusercontent.com/OCA/contract/17.0/contract/static/src/screenshots/portal-my.png
.. |image1| image:: https://raw.githubusercontent.com/OCA/contract/17.0/contract/static/src/screenshots/portal-list.png
.. |image2| image:: https://raw.githubusercontent.com/OCA/contract/17.0/contract/static/src/screenshots/portal-detail.png
.. |image| image:: https://raw.githubusercontent.com/OCA/contract/18.0/contract/static/src/screenshots/portal-my.png
.. |image1| image:: https://raw.githubusercontent.com/OCA/contract/18.0/contract/static/src/screenshots/portal-list.png
.. |image2| image:: https://raw.githubusercontent.com/OCA/contract/18.0/contract/static/src/screenshots/portal-detail.png

Known issues / Roadmap
======================
Expand All @@ -109,7 +109,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/contract/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20contract%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20contract%0Aversion:%2018.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.

Expand Down Expand Up @@ -166,6 +166,6 @@ 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/contract <https://github.com/OCA/contract/tree/17.0/contract>`_ project on GitHub.
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/18.0/contract>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion contract/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

{
"name": "Recurring - Contracts Management",
"version": "17.0.1.1.1",
"version": "18.0.1.0.0",
"category": "Contract Management",
"license": "AGPL-3",
"author": "Tecnativa, ACSONE SA/NV, Odoo Community Association (OCA)",
Expand Down
4 changes: 2 additions & 2 deletions contract/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def _prepare_home_portal_values(self, counters):
contract_model = request.env["contract.contract"]
contract_count = (
contract_model.search_count([])
if contract_model.check_access_rights("read", raise_exception=False)
if contract_model.check_access("read")
else 0
)
values["contract_count"] = contract_count
Expand Down Expand Up @@ -46,7 +46,7 @@ def portal_my_contracts(
values = self._prepare_portal_layout_values()
contract_obj = request.env["contract.contract"]
# Avoid error if the user does not have access.
if not contract_obj.check_access_rights("read", raise_exception=False):
if not contract_obj.check_access("read"):
return request.redirect("/my")
domain = self._get_filter_domain(kw)
searchbar_sortings = {
Expand Down
2 changes: 0 additions & 2 deletions contract/data/contract_cron.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
</record>
</odoo>
2 changes: 0 additions & 2 deletions contract/data/contract_renew_cron.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
</record>
</odoo>
33 changes: 17 additions & 16 deletions contract/data/mail_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,30 @@
&amp;nbsp;&amp;nbsp;Contract: <strong t-out="object.name" /><br />
<t t-if="object.date_start">
&amp;nbsp;&amp;nbsp;Contract Date Start: <t
t-out="object.date_start or ''"
/><br />
t-out="object.date_start or ''"
/><br />
</t>

<t t-if="object.user_id">
<t t-if="object.user_id.email">
<t t-if="object.user_id.email">
&amp;nbsp;&amp;nbsp;Your Contact: <a
t-att-href="'mailto:%s?subject=Contract %s' % (object.user_id.email, object.name)"
t-out="object.user_id.name"
/>
t-att-href="'mailto:%s?subject=Contract %s' % (object.user_id.email, object.name)"
t-out="object.user_id.name"
/>
</t>
<t t-else="">
<t t-else="">
&amp;nbsp;&amp;nbsp;Your Contact: <t
t-out="object.user_id.name"
/>
t-out="object.user_id.name"
/>
</t>
</t>
</t>
</p>

<br />
<p>If you have any questions, do not hesitate to contact us.</p>
<p>Thank you for choosing <t
t-out="object.company_id.name or 'us'"
/>!</p>
t-out="object.company_id.name or 'us'"
/>!</p>
<br />
<br />
<div
Expand All @@ -63,7 +63,8 @@
<strong
style="text-transform:uppercase;"
t-out="object.company_id.name"
/></h3>
/>
</h3>
</div>
<div
style="width: 347px; margin: 0px; padding: 5px 14px; line-height: 16px; background-color: #F2F2F2;"
Expand All @@ -84,9 +85,9 @@
<t t-if="object.company_id.website">
<div>
Web: <a
t-att-href="object.company_id.website"
t-out="object.company_id.website"
/>
t-att-href="object.company_id.website"
t-out="object.company_id.website"
/>
</div>
</t>
</div>
Expand Down
4 changes: 2 additions & 2 deletions contract/models/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,12 @@ def action_show_invoices(self):
"type": "ir.actions.act_window",
"name": "Invoices",
"res_model": "account.move",
"view_mode": "tree,kanban,form,calendar,pivot,graph,activity",
"view_mode": "list,kanban,form,calendar,pivot,graph,activity",
"domain": [("id", "in", self._get_related_invoices().ids)],
"context": ctx,
}
if tree_view and form_view:
action["views"] = [(tree_view.id, "tree"), (form_view.id, "form")]
action["views"] = [(tree_view.id, "list"), (form_view.id, "form")]
return action

@api.depends("contract_line_ids.date_end")
Expand Down
2 changes: 0 additions & 2 deletions contract/report/contract_views.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="report_contract" model="ir.actions.report">
<field name="name">Contract</field>
<field name="model">contract.contract</field>
Expand All @@ -10,5 +9,4 @@
<field name="binding_model_id" ref="model_contract_contract" />
<field name="binding_type">report</field>
</record>

</odoo>
2 changes: 1 addition & 1 deletion contract/report/report_contract.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<p t-if="o.partner_id.vat">VAT: <span t-field="o.partner_id.vat" /></p>
</t>
<div class="page">
<div class="oe_structure" />
<div class="oe_structure" id="oe_structure_contract" />
<div class="row" id="header_info">
<div class="col-3">
<strong>Responsible: </strong>
Expand Down
12 changes: 6 additions & 6 deletions contract/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Recurring - Contracts Management</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d03061fa09dd38d53cbaf6f7ca79de5ff114d100162c7f7646d6a6f301ad3941
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/contract/tree/17.0/contract"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/contract-17-0/contract-17-0-contract"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/contract&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/contract/tree/18.0/contract"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/contract-18-0/contract-18-0-contract"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/contract&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module enables contracts management with recurring invoicing
functions. Also you can print and send by email contract report.</p>
<p>It works for customer contract and supplier contracts.</p>
Expand Down Expand Up @@ -435,9 +435,9 @@ <h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<ul class="simple">
<li>Contracts appear in portal to following users in every contract:</li>
</ul>
<p><img alt="image" src="https://raw.githubusercontent.com/OCA/contract/17.0/contract/static/src/screenshots/portal-my.png" /></p>
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/contract/17.0/contract/static/src/screenshots/portal-list.png" /></p>
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/contract/17.0/contract/static/src/screenshots/portal-detail.png" /></p>
<p><img alt="image" src="https://raw.githubusercontent.com/OCA/contract/18.0/contract/static/src/screenshots/portal-my.png" /></p>
<p><img alt="image1" src="https://raw.githubusercontent.com/OCA/contract/18.0/contract/static/src/screenshots/portal-list.png" /></p>
<p><img alt="image2" src="https://raw.githubusercontent.com/OCA/contract/18.0/contract/static/src/screenshots/portal-detail.png" /></p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
Expand All @@ -451,7 +451,7 @@ <h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/contract/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/contract/issues/new?body=module:%20contract%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/contract/issues/new?body=module:%20contract%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -511,7 +511,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/17.0/contract">OCA/contract</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/18.0/contract">OCA/contract</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
5 changes: 2 additions & 3 deletions contract/tests/test_portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ def test_tour(self):
# Contract access
self.authenticate("portal", "portal")
http.root.session_store.save(self.session)
url_contract = "/my/contracts/{}?access_token={}".format(
contract.id,
contract.access_token,
url_contract = (
f"/my/contracts/{contract.id}?access_token={contract.access_token}"
)
self.assertEqual(self.url_open(url=url_contract).status_code, 200)
contract.message_unsubscribe(partner_ids=user_portal.partner_id.ids)
Expand Down
6 changes: 1 addition & 5 deletions contract/views/abstract_contract_line.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<group>
<field name="automatic_price" />


<field name="price_unit" readonly="automatic_price" />
<field name="quantity" />
</group>
Expand All @@ -35,10 +34,7 @@
groups="uom.group_uom"
required="not display_type"
/>
<field
name="discount"
groups="product.group_discount_per_so_line"
/>
<field name="discount" />
<field name="price_subtotal" readonly="1" />
</group>
</group>
Expand Down
Loading

0 comments on commit 6a4d57f

Please sign in to comment.