[MIG] agreement: Migration to 14.0

This commit is contained in:
newtratip
2021-02-16 12:10:07 +07:00
parent 80b64c233a
commit 8c16c94ab9
10 changed files with 37 additions and 45 deletions

View File

@@ -14,13 +14,13 @@ Agreement
: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/13.0/agreement
:target: https://github.com/OCA/contract/tree/14.0/agreement
:alt: OCA/contract
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/contract-13-0/contract-13-0-agreement
:target: https://translation.odoo-community.org/projects/contract-14-0/contract-14-0-agreement
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/110/13.0
:target: https://runbot.odoo-community.org/runbot/110/14.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -51,7 +51,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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/contract/issues/new?body=module:%20agreement%0Aversion:%2013.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:%20agreement%0Aversion:%2014.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.
@@ -74,6 +74,8 @@ Contributors
* Sergio Teruel
* Tharathip Chaweewongphan <tharathipc@ecosoft.co.th>
Maintainers
~~~~~~~~~~~
@@ -98,6 +100,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-ygol| |maintainer-alexis-via|
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/13.0/agreement>`_ project on GitHub.
This module is part of the `OCA/contract <https://github.com/OCA/contract/tree/14.0/agreement>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -4,7 +4,7 @@
{
"name": "Agreement",
"summary": "Adds an agreement object",
"version": "13.0.1.0.0",
"version": "14.0.1.0.0",
"category": "Contract",
"author": "Akretion, "
"Yves Goldberg (Ygol Internetwork), "
@@ -20,6 +20,9 @@
],
"demo": ["demo/demo.xml"],
"development_status": "Beta",
"maintainers": ["ygol", "alexis-via"],
"maintainers": [
"ygol",
"alexis-via",
],
"installable": True,
}

View File

@@ -1,8 +0,0 @@
<?xml version='1.0' encoding='utf-8' ?>
<odoo>
<record id="agreement_rule" model="ir.rule">
<field
name="domain_force"
>['|', ('company_id', '=', False), ('company_id', 'in', company_ids)]</field>
</record>
</odoo>

View File

@@ -1,11 +0,0 @@
# Copyright 2021 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade # pylint: disable=W7936
@openupgrade.migrate()
def migrate(env, version):
openupgrade.load_data(
env.cr, "agreement", "migrations/13.0.1.0.0/noupdate_changes.xml"
)

View File

@@ -10,14 +10,14 @@ class Agreement(models.Model):
_description = "Agreement"
_inherit = ["mail.thread", "mail.activity.mixin"]
code = fields.Char(required=True, track_visibility="onchange")
name = fields.Char(required=True, track_visibility="onchange")
code = fields.Char(required=True, tracking=True)
name = fields.Char(required=True, tracking=True)
partner_id = fields.Many2one(
"res.partner",
string="Partner",
ondelete="restrict",
domain=[("parent_id", "=", False)],
track_visibility="onchange",
tracking=True,
)
company_id = fields.Many2one(
"res.company",
@@ -40,12 +40,12 @@ class Agreement(models.Model):
"_domain_selection",
string="Domain",
default="sale",
track_visibility="onchange",
tracking=True,
)
active = fields.Boolean(default=True)
signature_date = fields.Date(track_visibility="onchange")
start_date = fields.Date(track_visibility="onchange")
end_date = fields.Date(track_visibility="onchange")
signature_date = fields.Date(tracking=True)
start_date = fields.Date(tracking=True)
end_date = fields.Date(tracking=True)
@api.model
def _domain_selection(self):

View File

@@ -4,3 +4,5 @@
* `Tecnativa <https://www.tecnativa.com>`_:
* Sergio Teruel
* Tharathip Chaweewongphan <tharathipc@ecosoft.co.th>

View File

@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Agreement</title>
<style type="text/css">
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" 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" href="https://github.com/OCA/contract/tree/13.0/agreement"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/contract-13-0/contract-13-0-agreement"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/110/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" 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" href="https://github.com/OCA/contract/tree/14.0/agreement"><img alt="OCA/contract" src="https://img.shields.io/badge/github-OCA%2Fcontract-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/contract-14-0/contract-14-0-agreement"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/110/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module adds an <em>Agreement</em> object with the following properties:</p>
<ul class="simple">
<li>code,</li>
@@ -398,7 +398,7 @@ ul.auto-toc {
<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 smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/contract/issues/new?body=module:%20agreement%0Aversion:%2013.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:%20agreement%0Aversion:%2014.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">
@@ -426,6 +426,8 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
</ul>
</blockquote>
</li>
<li><p class="first">Tharathip Chaweewongphan &lt;<a class="reference external" href="mailto:tharathipc&#64;ecosoft.co.th">tharathipc&#64;ecosoft.co.th</a>&gt;</p>
</li>
</ul>
</div>
<div class="section" id="maintainers">
@@ -437,7 +439,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external" href="https://github.com/ygol"><img alt="ygol" src="https://github.com/ygol.png?size=40px" /></a> <a class="reference external" href="https://github.com/alexis-via"><img alt="alexis-via" src="https://github.com/alexis-via.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/contract/tree/13.0/agreement">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/14.0/agreement">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>

View File

@@ -1,6 +1,7 @@
# Copyright 2021 Ecosoft Co., Ltd (http://ecosoft.co.th)
# Copyright 2021 Sergio Teruel - Tecnativa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
from odoo.tests.common import TransactionCase
@@ -8,7 +9,10 @@ class TestAgreement(TransactionCase):
def setUp(self):
super().setUp()
self.agreement_type = self.env["agreement.type"].create(
{"name": "Test Agreement Type", "domain": "purchase"}
{
"name": "Test Agreement Type",
"domain": "purchase",
}
)
self.agreement = self.env.ref("agreement.market1")

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" ?>
<?xml version="1.0" encoding="utf-8" ?>
<!--
© 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- Agreement Type List View-->
<record model="ir.ui.view" id="agreement_type_list_view">
<record id="agreement_type_list_view" model="ir.ui.view">
<field name="name">Agreement Type List</field>
<field name="model">agreement.type</field>
<field name="arch" type="xml">
@@ -12,7 +12,7 @@
</field>
</record>
<!-- Agreement Type Form View -->
<record model="ir.ui.view" id="agreement_type_form_view">
<record id="agreement_type_form_view" model="ir.ui.view">
<field name="name">Agreement Type Form</field>
<field name="model">agreement.type</field>
<field name="arch" type="xml">
@@ -28,9 +28,7 @@
<field name="active" invisible="1" />
<div class="oe_title">
<label for="name" class="oe_edit_only" />
<h1>
<field name="name" />
</h1>
<h1><field name="name" /></h1>
</div>
<group name="main">
<field name="domain" widget="radio" />
@@ -69,7 +67,7 @@
</field>
</record>
<!-- Actions opening views on models -->
<record model="ir.actions.act_window" id="agreement_type_action">
<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>