changeset 3c31017e20f7 in modules/carrier:default
details: https://hg.tryton.org/modules/carrier?cmd=changeset;node=3c31017e20f7
description:
Add One2Many to selections on carrier
This allow to copy also the selection when copying a carrier.
issue8817
review270541005
diffstat:
CHANGELOG | 2 ++
carrier.py | 1 +
carrier.xml | 11 +++++++++--
view/selection_list.xml | 8 ++++++++
view/selection_list_sequence.xml | 8 ++++++++
view/selection_tree.xml | 8 --------
6 files changed, 28 insertions(+), 10 deletions(-)
diffs (84 lines):
diff -r e096094f8171 -r 3c31017e20f7 CHANGELOG
--- a/CHANGELOG Wed Dec 04 11:09:35 2019 +0100
+++ b/CHANGELOG Thu Dec 05 22:29:59 2019 +0100
@@ -1,3 +1,5 @@
+* Add One2Many to selections on carrier
+
Version 5.4.0 - 2019-11-04
* Bug fixes (see mercurial logs for details)
diff -r e096094f8171 -r 3c31017e20f7 carrier.py
--- a/carrier.py Wed Dec 04 11:09:35 2019 +0100
+++ b/carrier.py Thu Dec 05 22:29:59 2019 +0100
@@ -24,6 +24,7 @@
('product', 'Product Price'),
], 'Carrier Cost Method', required=True,
help='Method to compute carrier cost.')
+ selections = fields.One2Many('carrier.selection', 'carrier', "Selections")
@staticmethod
def default_carrier_cost_method():
diff -r e096094f8171 -r 3c31017e20f7 carrier.xml
--- a/carrier.xml Wed Dec 04 11:09:35 2019 +0100
+++ b/carrier.xml Thu Dec 05 22:29:59 2019 +0100
@@ -77,7 +77,14 @@
<record model="ir.ui.view" id="carrier_selection_view_list">
<field name="model">carrier.selection</field>
<field name="type">tree</field>
- <field name="name">selection_tree</field>
+ <field name="priority" eval="10"/>
+ <field name="name">selection_list</field>
+ </record>
+ <record model="ir.ui.view" id="carrier_selection_view_list_sequence">
+ <field name="model">carrier.selection</field>
+ <field name="type">tree</field>
+ <field name="priority" eval="20"/>
+ <field name="name">selection_list_sequence</field>
</record>
<record model="ir.action.act_window" id="act_carrier_selection_form">
@@ -87,7 +94,7 @@
<record model="ir.action.act_window.view"
id="act_carrier_selection_form_view1">
<field name="sequence" eval="10"/>
- <field name="view" ref="carrier_selection_view_list"/>
+ <field name="view" ref="carrier_selection_view_list_sequence"/>
<field name="act_window" ref="act_carrier_selection_form"/>
</record>
<record model="ir.action.act_window.view"
diff -r e096094f8171 -r 3c31017e20f7 view/selection_list.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/selection_list.xml Thu Dec 05 22:29:59 2019 +0100
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<tree>
+ <field name="from_country" expand="1"/>
+ <field name="to_country" expand="1"/>
+ <field name="carrier" expand="2"/>
+</tree>
diff -r e096094f8171 -r 3c31017e20f7 view/selection_list_sequence.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/view/selection_list_sequence.xml Thu Dec 05 22:29:59 2019 +0100
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<tree editable="top" sequence="sequence">
+ <field name="from_country" expand="1"/>
+ <field name="to_country" expand="1"/>
+ <field name="carrier" expand="2"/>
+</tree>
diff -r e096094f8171 -r 3c31017e20f7 view/selection_tree.xml
--- a/view/selection_tree.xml Wed Dec 04 11:09:35 2019 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<tree editable="top" sequence="sequence">
- <field name="from_country" expand="1"/>
- <field name="to_country" expand="1"/>
- <field name="carrier" expand="2"/>
-</tree>