mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[MIG] contract_layout_category_hide_detail: Migration to 13.0
This commit is contained in:
@@ -4,11 +4,12 @@
|
|||||||
{
|
{
|
||||||
"name": "Contract layout category hide detail",
|
"name": "Contract layout category hide detail",
|
||||||
"summary": "Hide details for sections in Contract lines",
|
"summary": "Hide details for sections in Contract lines",
|
||||||
"version": "12.0.1.0.0",
|
"version": "13.0.1.0.0",
|
||||||
"category": "Contract Management",
|
"category": "Contract Management",
|
||||||
"website": "https://github.com/OCA/contract",
|
"website": "https://github.com/OCA/contract",
|
||||||
"author": "Tecnativa, " "Odoo Community Association (OCA)",
|
"author": "Tecnativa, " "Odoo Community Association (OCA)",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"depends": ["contract", "sale_layout_category_hide_detail"],
|
"depends": ["contract", "sale_layout_category_hide_detail"],
|
||||||
|
"development_status": "Production/Stable",
|
||||||
"data": ["views/abstract_contract_line.xml", "views/contract.xml"],
|
"data": ["views/abstract_contract_line.xml", "views/contract.xml"],
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,14 @@
|
|||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
|
||||||
from odoo import api, models
|
from odoo import models
|
||||||
|
|
||||||
|
|
||||||
class ContractLine(models.Model):
|
class ContractLine(models.Model):
|
||||||
_inherit = "contract.line"
|
_inherit = "contract.line"
|
||||||
|
|
||||||
@api.multi
|
def _prepare_invoice_line(self, move_form):
|
||||||
def _prepare_invoice_line(self, invoice_id=False, invoice_values=False):
|
vals = super()._prepare_invoice_line(move_form)
|
||||||
vals = super()._prepare_invoice_line(invoice_id, invoice_values)
|
|
||||||
# If the line has skip_zero_qty field (provided by contract_variable
|
# If the line has skip_zero_qty field (provided by contract_variable
|
||||||
# quantity module) set to 'True' and 'quantity' field' is zero then
|
# quantity module) set to 'True' and 'quantity' field' is zero then
|
||||||
# 'vals' will be equal to {}
|
# 'vals' will be equal to {}
|
||||||
|
|||||||
@@ -2,3 +2,4 @@
|
|||||||
|
|
||||||
* Ernesto Tejeda
|
* Ernesto Tejeda
|
||||||
* Pedro M. Baeza
|
* Pedro M. Baeza
|
||||||
|
* Víctor Martínez
|
||||||
|
|||||||
@@ -1,10 +1,47 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="contract_contract_form_view" model="ir.ui.view">
|
<record id="contract_contract_form_view_hide_details" model="ir.ui.view">
|
||||||
<field name="name">contract.contract.form.hide.details</field>
|
<field name="name">contract.contract.form.hide.details</field>
|
||||||
<field name="model">contract.contract</field>
|
<field name="model">contract.contract</field>
|
||||||
<field name="inherit_id" ref="contract.contract_contract_form_view" />
|
<field name="inherit_id" ref="contract.contract_contract_form_view" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
|
<xpath
|
||||||
|
expr="//field[@name='contract_line_fixed_ids']/tree"
|
||||||
|
position="inside"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="show_details"
|
||||||
|
widget="boolean_fa_icon"
|
||||||
|
options="{
|
||||||
|
'show_in_line_section': true,
|
||||||
|
'fa_icons': {
|
||||||
|
'icon_true': 'fa-eye',
|
||||||
|
'icon_false': 'fa-eye-slash',
|
||||||
|
},
|
||||||
|
'terminology': {
|
||||||
|
'hover_true': 'Switch to: details hidden',
|
||||||
|
'hover_false': 'Switch to: details shown',
|
||||||
|
},
|
||||||
|
}"
|
||||||
|
attrs="{'invisible': [('display_type', '!=', 'line_section')]}"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="show_subtotal"
|
||||||
|
widget="boolean_fa_icon"
|
||||||
|
options="{
|
||||||
|
'show_in_line_section': true,
|
||||||
|
'fa_icons': {
|
||||||
|
'icon_true': 'fa-plus-circle',
|
||||||
|
'icon_false': 'fa-minus-circle',
|
||||||
|
},
|
||||||
|
'terminology': {
|
||||||
|
'hover_true': 'Switch to: subtotal hidden',
|
||||||
|
'hover_false': 'Switch to: subtotal shown',
|
||||||
|
},
|
||||||
|
}"
|
||||||
|
attrs="{'invisible': ['|', ('display_type', '!=', 'line_section'), ('show_details', '!=', True)]}"
|
||||||
|
/>
|
||||||
|
</xpath>
|
||||||
<xpath expr="//field[@name='contract_line_ids']/tree" position="inside">
|
<xpath expr="//field[@name='contract_line_ids']/tree" position="inside">
|
||||||
<field
|
<field
|
||||||
name="show_details"
|
name="show_details"
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
bank-payment
|
bank-payment
|
||||||
|
sale-reporting
|
||||||
|
|||||||
Reference in New Issue
Block a user