Skip to content

Commit e7b35be

Browse files
committed
[12.0][ADD] z_migration
1 parent 4fd05e0 commit e7b35be

File tree

5 files changed

+85
-0
lines changed

5 files changed

+85
-0
lines changed

z_migration/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2019 Ecosoft Co., Ltd (https://ecosoft.co.th/)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
3+
4+
from . import models

z_migration/__manifest__.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2019 Ecosoft Co., Ltd (https://ecosoft.co.th/)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
3+
4+
{
5+
'name': 'ACM :: Data Migration',
6+
'version': '12.0.1.0.0',
7+
'author': 'Ecosoft, Odoo Community Association (OCA)',
8+
'license': 'AGPL-3',
9+
'website': 'https://github.com/OCA/contract',
10+
'category': 'Agreement',
11+
'depends': [
12+
'acm',
13+
],
14+
'data': [
15+
'views/agreement_views.xml',
16+
],
17+
}

z_migration/models/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2019 Ecosoft Co., Ltd (https://ecosoft.co.th/)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
3+
4+
from . import agreement

z_migration/models/agreement.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2019 Ecosoft Co., Ltd (https://ecosoft.co.th/)
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
3+
4+
from odoo import models, api
5+
from lxml import etree
6+
7+
8+
class Agreement(models.Model):
9+
_inherit = 'agreement'
10+
11+
@api.model
12+
def fields_view_get(self, view_id=None, view_type='form',
13+
toolbar=False, submenu=False):
14+
res = super(Agreement, self).fields_view_get(
15+
view_id, view_type, toolbar=toolbar, submenu=submenu)
16+
root = etree.fromstring(res['arch'])
17+
root.set('create', 'true')
18+
root.set('edit', 'true')
19+
root.set('duplicate', 'true')
20+
root.set('delete', 'true')
21+
res['arch'] = etree.tostring(root)
22+
return res

z_migration/views/agreement_views.xml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<odoo>
2+
<!-- Tree View -->
3+
<record id="agreement_line_view_tree" model="ir.ui.view">
4+
<field name="name">areement.line.view.tree</field>
5+
<field name="model">agreement.line</field>
6+
<field name="priority" eval="9999"/>
7+
<field name="arch" type="xml">
8+
<tree>
9+
<field name="product_id"/>
10+
<field name="name"/>
11+
<field name="qty"/>
12+
<field name="uom_id"/>
13+
<field name="lst_price"/>
14+
</tree>
15+
</field>
16+
</record>
17+
18+
<!-- Action -->
19+
<record id="agreement_line_action" model="ir.actions.act_window">
20+
<field name="name">Agreement Lines</field>
21+
<field name="res_model">agreement.line</field>
22+
<field name="view_mode">tree,form</field>
23+
</record>
24+
<record id="agreement_line_action_tree_view" model="ir.actions.act_window.view">
25+
<field eval="10" name="sequence"/>
26+
<field name="view_mode">tree</field>
27+
<field name="view_id" ref="agreement_line_view_tree" />
28+
<field name="act_window_id" ref="agreement_line_action" />
29+
</record>
30+
31+
<!-- Menu -->
32+
<menuitem
33+
name="Agreement Lines"
34+
id="agreement_line_menu"
35+
parent="agreement_legal.agreement_operations"
36+
sequence="15"
37+
action="agreement_line_action"/>
38+
</odoo>

0 commit comments

Comments
 (0)