Skip to content

Commit 233b77a

Browse files
[MIG] contract_variable_quantity: Migration to 17.0
1 parent 9af4922 commit 233b77a

10 files changed

Lines changed: 26 additions & 37 deletions

File tree

contract_variable_quantity/README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ Usage
6464

6565
To use this module, you need to:
6666

67-
1. Go to Invoicing > Sales > Contracts and select or create a new
68-
contract.
67+
1. Go to Invoicing > Customers > Customers Contracts and select or
68+
create a new contract.
6969
2. Check *Generate recurring invoices automatically*.
7070
3. Add a new recurring invoicing line.
7171
4. Select "Variable quantity" in column "Qty. type".
@@ -98,6 +98,7 @@ Contributors
9898
- Carlos Roca
9999
- Víctor Martínez
100100
- Carolina Fernandez
101+
- Juan José Seguí
101102

102103
- Dave Lasley <dave@laslabs.com>
103104

contract_variable_quantity/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
{
88
"name": "Variable quantity in contract recurrent invoicing",
9-
"version": "16.0.1.1.0",
9+
"version": "17.0.1.0.0",
1010
"category": "Contract Management",
1111
"license": "AGPL-3",
1212
"author": "Tecnativa, Odoo Community Association (OCA)",

contract_variable_quantity/models/contract_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def _get_quantity_to_invoice(
3333
"contract": self.contract_id,
3434
}
3535
safe_eval(
36-
self.qty_formula_id.code.strip(),
36+
str(self.qty_formula_id.code).strip(),
3737
eval_context,
3838
mode="exec",
3939
nocopy=True,

contract_variable_quantity/readme/CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
> - Carlos Roca
55
> - Víctor Martínez
66
> - Carolina Fernandez
7+
> - Juan José Seguí
8+
79

810
- Dave Lasley \<<dave@laslabs.com>\>
911

contract_variable_quantity/readme/USAGE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
To use this module, you need to:
22

3-
1. Go to Invoicing \> Sales \> Contracts and select or create a new
3+
1. Go to Invoicing \> Customers \> Customers Contracts and select or create a new
44
contract.
55
2. Check *Generate recurring invoices automatically*.
66
3. Add a new recurring invoicing line.

contract_variable_quantity/static/description/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
412412
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
413413
<p>To use this module, you need to:</p>
414414
<ol class="arabic simple">
415-
<li>Go to Invoicing &gt; Sales &gt; Contracts and select or create a new
416-
contract.</li>
415+
<li>Go to Invoicing &gt; Customers &gt; Customers Contracts and select or
416+
create a new contract.</li>
417417
<li>Check <em>Generate recurring invoices automatically</em>.</li>
418418
<li>Add a new recurring invoicing line.</li>
419419
<li>Select “Variable quantity” in column “Qty. type”.</li>
@@ -446,6 +446,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
446446
<li>Carlos Roca</li>
447447
<li>Víctor Martínez</li>
448448
<li>Carolina Fernandez</li>
449+
<li>Juan José Seguí</li>
449450
</ul>
450451
</blockquote>
451452
</li>

contract_variable_quantity/views/abstract_contract_line.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
<xpath expr="//field[@name='quantity']" position="after">
1515
<field
1616
name="qty_formula_id"
17-
attrs="{'required': [('qty_type', '=', 'variable')], 'invisible': [('qty_type', '!=', 'variable')]}"
17+
required="qty_type == 'variable'"
18+
invisible="qty_type != 'variable'"
1819
/>
1920
</xpath>
2021
<xpath expr="//field[@name='quantity']" position="attributes">
21-
<attribute name="attrs">{'required': [('qty_type', '=',
22-
'fixed')], 'invisible': [('qty_type', '!=', 'fixed')]}
23-
</attribute>
22+
<attribute name="required">"qty_type == 'fixed'"</attribute>
23+
<attribute name="invisible">"qty_type != 'fixed'"</attribute>
2424
</xpath>
2525
</field>
2626
</record>

contract_variable_quantity/views/contract.xml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,27 @@
1212
position="before"
1313
>
1414
<field name="qty_type" />
15-
<field
16-
name="qty_formula_id"
17-
attrs="{'invisible': [('qty_type', '!=', 'variable')]}"
18-
/>
15+
<field name="qty_formula_id" invisible="qty_type != 'variable'" />
1916
</xpath>
2017
<xpath
2118
expr="//field[@name='contract_line_ids']/tree/field[@name='quantity']"
2219
position="attributes"
2320
>
24-
<attribute
25-
name="attrs"
26-
>{'invisible': [('qty_type', '!=', 'fixed')]}</attribute>
21+
<attribute name="invisible">"qty_type != 'fixed'"</attribute>
2722
</xpath>
2823
<xpath
2924
expr="//field[@name='contract_line_fixed_ids']/tree/field[@name='quantity']"
3025
position="before"
3126
>
3227
<field name="qty_type" />
33-
<field
34-
name="qty_formula_id"
35-
attrs="{'invisible': [('qty_type', '!=', 'variable')]}"
36-
/>
28+
<field name="qty_formula_id" invisible="qty_type != 'variable'" />
3729
</xpath>
3830
<xpath
3931
expr="//field[@name='contract_line_fixed_ids']/tree/field[@name='quantity']"
4032
position="attributes"
4133
>
42-
<attribute
43-
name="attrs"
44-
>{'invisible': [('qty_type', '!=', 'fixed')]}</attribute>
45-
</xpath>
34+
<attribute name="invisible">qty_type != 'fixed'</attribute>
35+
</xpath>
4636
</field>
4737
</record>
4838
</odoo>

contract_variable_quantity/views/contract_line_views.xml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,10 @@
1111
<field name="arch" type="xml">
1212
<field name="quantity" position="before">
1313
<field name="qty_type" />
14-
<field
15-
name="qty_formula_id"
16-
attrs="{'invisible': [('qty_type', '!=', 'variable')]}"
17-
/>
14+
<field name="qty_formula_id" invisible="qty_type != 'variable'" />
1815
</field>
1916
<field name="quantity" position="attributes">
20-
<attribute
21-
name="attrs"
22-
>{'invisible': [('qty_type', '!=', 'fixed')]}</attribute>
17+
<attribute name="invisible">"qty_type != 'fixed'"</attribute>
2318
</field>
2419
</field>
2520
</record>

contract_variable_quantity/views/contract_template.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
>
1818
<field
1919
name="qty_formula_id"
20-
attrs="{'required': [('qty_type', '=', 'variable')], 'invisible': [('qty_type', '!=', 'variable')]}"
20+
required="qty_type == 'variable'"
21+
invisible="qty_type != 'variable'"
2122
/>
2223
</xpath>
2324
<xpath
2425
expr="//field[@name='contract_line_ids']//field[@name='quantity']"
2526
position="attributes"
2627
>
27-
<attribute
28-
name="attrs"
29-
>{'required': [('qty_type', '=', 'fixed')], 'invisible': [('qty_type', '!=', 'fixed')]}</attribute>
28+
<attribute name="required">"qty_type == 'fixed'"</attribute>
29+
<attribute name="invisible">"qty_type != 'fixed'"</attribute>
3030
</xpath>
3131
</field>
3232
</record>

0 commit comments

Comments
 (0)