Skip to content

Commit

Permalink
[MIG] agreement: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Tran committed Dec 2, 2024
1 parent a81443c commit 8822b10
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 154 deletions.
10 changes: 10 additions & 0 deletions agreement/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ Contributors

- Maxime Franco

- `Trobz <https://www.trobz.com/>`__:

- Nhan Tran <nhant@trobz.com>

Other credits
-------------

The migration of this module from 17.0 to 18.0 was financially supported
by Camptocamp.

Maintainers
-----------

Expand Down
2 changes: 1 addition & 1 deletion agreement/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Agreement",
"summary": "Adds an agreement object",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"category": "Contract",
"author": "Akretion, "
"Yves Goldberg (Ygol Internetwork), "
Expand Down
12 changes: 3 additions & 9 deletions agreement/models/agreement.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class Agreement(models.Model):
)
is_template = fields.Boolean(
string="Is a Template?",
default=False,
copy=False,
help="Set if the agreement is a template. "
"Template agreements don't require a partner.",
Expand Down Expand Up @@ -63,14 +62,9 @@ def _compute_domain(self):
else:
rec.domain = "sale"

def name_get(self):
res = []
for agr in self:
name = agr.name
if agr.code:
name = f"[{agr.code}] {agr.name}"
res.append((agr.id, name))
return res
def _compute_display_name(self):
for rec in self:
rec.display_name = f"[{rec.code}] {rec.name}"

_sql_constraints = [
(
Expand Down
4 changes: 4 additions & 0 deletions agreement/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
- [Acsone](https://www.acsone.eu/):

- Maxime Franco

- [Trobz](https://www.trobz.com/):

- Nhan Tran \<<nhant@trobz.com>\>
2 changes: 2 additions & 0 deletions agreement/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The migration of this module from 17.0 to 18.0 was financially supported
by Camptocamp.
15 changes: 13 additions & 2 deletions agreement/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ <h1 class="title">Agreement</h1>
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
<li><a class="reference internal" href="#other-credits" id="toc-entry-5">Other credits</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -434,10 +435,20 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<li>Maxime Franco</li>
</ul>
</li>
<li><p class="first"><a class="reference external" href="https://www.trobz.com/">Trobz</a>:</p>
<ul class="simple">
<li>Nhan Tran &lt;<a class="reference external" href="mailto:nhant&#64;trobz.com">nhant&#64;trobz.com</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-5">Other credits</a></h2>
<p>The migration of this module from 17.0 to 18.0 was financially supported
by Camptocamp.</p>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand Down
7 changes: 3 additions & 4 deletions agreement/tests/test_agreement.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ def test_agreement_type_change(self):
self.agreement.write({"agreement_type_id": self.agreement_type.id})
self.assertEqual(self.agreement.domain, self.agreement_type.domain)

def test_name_get(self):
res = self.agreement.name_get()
self.assertEqual(res[0][0], self.agreement.id)
self.assertEqual(res[0][1], f"[{self.agreement.code}] {self.agreement.name}")
def test_compute_display_name(self):
display_name = self.agreement.display_name
self.assertEqual(display_name, f"[{self.agreement.code}] {self.agreement.name}")

def test_copy(self):
agreement1 = self.agreement.copy(default={"code": "Test Code"})
Expand Down
135 changes: 0 additions & 135 deletions agreement/views/agreement.xml.orig

This file was deleted.

6 changes: 3 additions & 3 deletions agreement/views/agreement_type.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<field name="name">Agreement Type List</field>
<field name="model">agreement.type</field>
<field name="arch" type="xml">
<tree default_order="name">
<list default_order="name">
<field name="name" string="Type Name" />
<field name="domain" />
</tree>
</list>
</field>
</record>
<!-- Agreement Type Form View -->
Expand Down Expand Up @@ -71,6 +71,6 @@
<record id="agreement_type_action" model="ir.actions.act_window">
<field name="name">Agreement Types</field>
<field name="res_model">agreement.type</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>
</odoo>

0 comments on commit 8822b10

Please sign in to comment.