@@ -6,7 +6,7 @@ from trytond.i18n import gettext
|
||||
from trytond.model import ModelView, Workflow, fields
|
||||
from trytond.model.exceptions import AccessError
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
from trytond.pyson import Bool, Eval, If
|
||||
from trytond.tools import cached_property
|
||||
from trytond.transaction import Transaction, without_check_access
|
||||
|
||||
@@ -110,6 +110,13 @@ class InvoiceLine(metaclass=PoolMeta):
|
||||
cls.origin.domain = {}
|
||||
cls.origin.domain['purchase.line'] = [
|
||||
('type', '=', Eval('type')),
|
||||
If(Bool(Eval('_parent_invoice')),
|
||||
If(Eval('_parent_invoice', {}).get('type') != 'in',
|
||||
('id', '=', -1),
|
||||
()),
|
||||
If(Eval('invoice_type') != 'in',
|
||||
('id', '=', -1),
|
||||
())),
|
||||
]
|
||||
|
||||
@cached_property
|
||||
|
||||
@@ -9,7 +9,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="context"></field>
|
||||
<field
|
||||
name="domain"
|
||||
eval="[('purchases.id', 'in', Eval('active_ids', []))]"
|
||||
eval="[('purchases.id', 'in', Eval('active_ids', [])), ('type', '=', 'in')]"
|
||||
pyson="1"/>
|
||||
</record>
|
||||
<record model="ir.action.keyword"
|
||||
|
||||
@@ -6,7 +6,7 @@ from trytond.i18n import gettext
|
||||
from trytond.model import Workflow, fields
|
||||
from trytond.model.exceptions import AccessError
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Eval
|
||||
from trytond.pyson import Bool, Eval, If
|
||||
from trytond.transaction import Transaction, without_check_access
|
||||
|
||||
|
||||
@@ -118,6 +118,13 @@ class Line(metaclass=PoolMeta):
|
||||
cls.origin.domain = {}
|
||||
cls.origin.domain['sale.line'] = [
|
||||
('type', '=', Eval('type')),
|
||||
If(Bool(Eval('_parent_invoice')),
|
||||
If(Eval('_parent_invoice', {}).get('type') != 'out',
|
||||
('id', '=', -1),
|
||||
()),
|
||||
If(Eval('invoice_type') != 'out',
|
||||
('id', '=', -1),
|
||||
())),
|
||||
]
|
||||
|
||||
@fields.depends('origin')
|
||||
|
||||
@@ -8,7 +8,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="res_model">account.invoice</field>
|
||||
<field
|
||||
name="domain"
|
||||
eval="[('sales.id', 'in', Eval('active_ids', []))]"
|
||||
eval="[('sales.id', 'in', Eval('active_ids', [])), ('type', '=', 'out')]"
|
||||
pyson="1"/>
|
||||
</record>
|
||||
<record model="ir.action.keyword"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
from trytond.model import fields
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Bool, Eval, If
|
||||
from trytond.report import Report
|
||||
from trytond.tools import cached_property
|
||||
|
||||
@@ -34,6 +35,21 @@ class Invoice(metaclass=PoolMeta):
|
||||
class InvoiceLine(metaclass=PoolMeta):
|
||||
__name__ = 'account.invoice.line'
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super().__setup__()
|
||||
if not cls.origin.domain:
|
||||
cls.origin.domain = {}
|
||||
cls.origin.domain['sale.rental.line'] = [
|
||||
If(Bool(Eval('_parent_invoice')),
|
||||
If(Eval('_parent_invoice', {}).get('type') != 'out',
|
||||
('id', '=', -1),
|
||||
()),
|
||||
If(Eval('invoice_type') != 'out',
|
||||
('id', '=', -1),
|
||||
())),
|
||||
]
|
||||
|
||||
@fields.depends('product', 'origin')
|
||||
def on_change_product(self):
|
||||
pool = Pool()
|
||||
|
||||
@@ -8,7 +8,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="res_model">account.invoice</field>
|
||||
<field
|
||||
name="domain"
|
||||
eval="[('sale_rentals.id', 'in', Eval('active_ids', []))]"
|
||||
eval="[('sale_rentals.id', 'in', Eval('active_ids', [])), ('type', '=', 'out')]"
|
||||
pyson="1"/>
|
||||
</record>
|
||||
<record model="ir.action.keyword" id="act_account_invoice_form_keyword1">
|
||||
|
||||
@@ -1,11 +1,27 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.pyson import Bool, Eval, If
|
||||
|
||||
|
||||
class InvoiceLine(metaclass=PoolMeta):
|
||||
__name__ = 'account.invoice.line'
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super().__setup__()
|
||||
if not cls.origin.domain:
|
||||
cls.origin.domain = {}
|
||||
cls.origin.domain['sale.subscription.line'] = [
|
||||
If(Bool(Eval('_parent_invoice')),
|
||||
If(Eval('_parent_invoice', {}).get('type') != 'out',
|
||||
('id', '=', -1),
|
||||
()),
|
||||
If(Eval('invoice_type') != 'out',
|
||||
('id', '=', -1),
|
||||
())),
|
||||
]
|
||||
|
||||
@property
|
||||
def origin_name(self):
|
||||
pool = Pool()
|
||||
|
||||
@@ -218,7 +218,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="res_model">account.invoice</field>
|
||||
<field
|
||||
name="domain"
|
||||
eval="[('lines.origin.subscription.id', 'in', Eval('active_ids'), 'sale.subscription.line')]"
|
||||
eval="[('lines.origin.subscription.id', 'in', Eval('active_ids'), 'sale.subscription.line'), ('type', '=', 'out')]"
|
||||
pyson="1"/>
|
||||
</record>
|
||||
<record model="ir.action.keyword" id="act_subscription_invoice_relate_keyword1">
|
||||
|
||||
Reference in New Issue
Block a user