[tryton-commits] changeset in weblate:default Translated using Weblate (French)
changeset 649430ecc652 in weblate:default details: https://hg.tryton.org/weblate?cmd=changeset=649430ecc652 description: Translated using Weblate (French) Currently translated at 100.0% (162 of 162 strings) Translation: Tryton/sale_point Translate-URL: https://translate.tryton.org/projects/tryton/sale_point/fr/ diffstat: modules/sale_point/locale/fr.po | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diffs (30 lines): diff -r 963933a110ae -r 649430ecc652 modules/sale_point/locale/fr.po --- a/modules/sale_point/locale/fr.po Thu Apr 07 22:37:54 2022 + +++ b/modules/sale_point/locale/fr.po Thu Apr 07 22:30:06 2022 + @@ -3,7 +3,7 @@ "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-10-25 16:27+\n" -"PO-Revision-Date: 2021-10-26 08:08+\n" +"PO-Revision-Date: 2022-04-08 23:16+\n" "Last-Translator: Cédric Krier \n" "Language-Team: LANGUAGE \n" "Language: fr\n" @@ -11,7 +11,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.8.1\n" +"X-Generator: Weblate 4.11.2\n" msgctxt "field:product.gross_price,company:" msgid "Company" @@ -43,7 +43,7 @@ msgctxt "field:sale.point,address:" msgid "Address" -msgstr "" +msgstr "Adresse" msgctxt "field:sale.point,company:" msgid "Company"
[tryton-commits] changeset in weblate:default Translated using Weblate (French)
changeset 963933a110ae in weblate:default details: https://hg.tryton.org/weblate?cmd=changeset=963933a110ae description: Translated using Weblate (French) Currently translated at 100.0% (46 of 46 strings) Translation: Tryton/account_invoice_defer Translate-URL: https://translate.tryton.org/projects/tryton/account_invoice_defer/fr/ diffstat: modules/account_invoice_defer/locale/fr.po | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diffs (36 lines): diff -r eec4d2578ad5 -r 963933a110ae modules/account_invoice_defer/locale/fr.po --- a/modules/account_invoice_defer/locale/fr.poThu Apr 07 22:32:02 2022 + +++ b/modules/account_invoice_defer/locale/fr.poThu Apr 07 22:37:54 2022 + @@ -3,15 +3,15 @@ "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-04-19 07:55+\n" -"PO-Revision-Date: 2021-04-20 22:55+\n" -"Last-Translator: Cedric Krier \n" +"PO-Revision-Date: 2022-04-08 23:16+\n" +"Last-Translator: Cédric Krier \n" "Language-Team: LANGUAGE \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.5.3\n" +"X-Generator: Weblate 4.11.2\n" msgctxt "field:account.configuration,deferred_account_expense:" msgid "Deferred Account Expense" @@ -155,11 +155,11 @@ msgctxt "model:ir.message,text:msg_missing_deferred_account_expense" msgid "There is no deferred account expense configured." -msgstr "" +msgstr "Il n'y a aucun compte de charges différée configuré." msgctxt "model:ir.message,text:msg_missing_deferred_account_revenue" msgid "There is no deferred account revenue configured." -msgstr "" +msgstr "Il n'y a aucun compte de produit différée configuré." msgctxt "model:ir.model.button,confirm:invoice_deferred_run_button" msgid "Are you sure you want to defer the invoices?"
[tryton-commits] changeset in weblate:default Translated using Weblate (French)
changeset eec4d2578ad5 in weblate:default details: https://hg.tryton.org/weblate?cmd=changeset=eec4d2578ad5 description: Translated using Weblate (French) Currently translated at 100.0% (39 of 39 strings) Translation: Tryton/stock_quantity_early_planning Translate-URL: https://translate.tryton.org/projects/tryton/stock_quantity_early_planning/fr/ diffstat: modules/stock_quantity_early_planning/locale/fr.po | 9 - 1 files changed, 4 insertions(+), 5 deletions(-) diffs (34 lines): diff -r fd2c123158fa -r eec4d2578ad5 modules/stock_quantity_early_planning/locale/fr.po --- a/modules/stock_quantity_early_planning/locale/fr.poThu Apr 07 22:31:00 2022 + +++ b/modules/stock_quantity_early_planning/locale/fr.poThu Apr 07 22:32:02 2022 + @@ -3,15 +3,15 @@ "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-04-22 06:55+\n" -"PO-Revision-Date: 2021-10-16 08:14+\n" -"Last-Translator: Cedric Krier \n" +"PO-Revision-Date: 2022-04-08 23:16+\n" +"Last-Translator: Cédric Krier \n" "Language-Team: LANGUAGE \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.8.1\n" +"X-Generator: Weblate 4.11.2\n" msgctxt "field:stock.move,quantity_early_plans:" msgid "Quantity Early Plans" @@ -41,10 +41,9 @@ msgid "Early Date" msgstr "Date en avance" -#, fuzzy msgctxt "field:stock.quantity.early_plan,early_quantity:" msgid "Early Quantity" -msgstr "Date en avance" +msgstr "Quantité en avance" msgctxt "field:stock.quantity.early_plan,ignored_by:" msgid "Ignored by"
[tryton-commits] changeset in weblate:default Translated using Weblate (French)
changeset fd2c123158fa in weblate:default details: https://hg.tryton.org/weblate?cmd=changeset=fd2c123158fa description: Translated using Weblate (French) Currently translated at 100.0% (55 of 55 strings) Translation: Tryton/stock_lot_sled Translate-URL: https://translate.tryton.org/projects/tryton/stock_lot_sled/fr/ diffstat: modules/stock_lot_sled/locale/fr.po | 8 1 files changed, 4 insertions(+), 4 deletions(-) diffs (29 lines): diff -r d82cdd69e3d8 -r fd2c123158fa modules/stock_lot_sled/locale/fr.po --- a/modules/stock_lot_sled/locale/fr.po Thu Apr 07 22:30:42 2022 + +++ b/modules/stock_lot_sled/locale/fr.po Thu Apr 07 22:31:00 2022 + @@ -1,13 +1,13 @@ # msgid "" msgstr "" -"PO-Revision-Date: 2021-03-22 02:58+\n" -"Last-Translator: Cedric Krier \n" +"PO-Revision-Date: 2022-04-08 23:16+\n" +"Last-Translator: Cédric Krier \n" "Language: fr\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.4\n" +"X-Generator: Weblate 4.11.2\n" msgctxt "field:product.product,expiration_state:" msgid "Expiration State" @@ -237,7 +237,7 @@ msgctxt "view:stock.configuration:" msgid "Lot" -msgstr "" +msgstr "Lot" #, fuzzy #~ msgctxt "field:stock.location.lot.shelf_life,create_date:"
[tryton-commits] changeset in weblate:default Translated using Weblate (French)
changeset d82cdd69e3d8 in weblate:default details: https://hg.tryton.org/weblate?cmd=changeset=d82cdd69e3d8 description: Translated using Weblate (French) Currently translated at 100.0% (65 of 65 strings) Translation: Tryton/sale_supply_drop_shipment Translate-URL: https://translate.tryton.org/projects/tryton/sale_supply_drop_shipment/fr/ diffstat: modules/sale_supply_drop_shipment/locale/fr.po | 7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diffs (28 lines): diff -r db314fe62db9 -r d82cdd69e3d8 modules/sale_supply_drop_shipment/locale/fr.po --- a/modules/sale_supply_drop_shipment/locale/fr.poThu Apr 07 22:33:10 2022 + +++ b/modules/sale_supply_drop_shipment/locale/fr.poThu Apr 07 22:30:42 2022 + @@ -1,13 +1,13 @@ # msgid "" msgstr "" -"PO-Revision-Date: 2021-04-19 21:49+\n" -"Last-Translator: Cedric Krier \n" +"PO-Revision-Date: 2022-04-08 23:16+\n" +"Last-Translator: Cédric Krier \n" "Language: fr\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.5.3\n" +"X-Generator: Weblate 4.11.2\n" msgctxt "field:purchase.configuration,purchase_drop_location:" msgid "Purchase Drop Location" @@ -280,7 +280,6 @@ msgid "Waiting" msgstr "En attente" -#, fuzzy msgctxt "view:stock.configuration:" msgid "Drop Shipment Sequence" msgstr "Séquence de livraison directe"
[tryton-commits] changeset in weblate:default Translated using Weblate (French)
changeset db314fe62db9 in weblate:default details: https://hg.tryton.org/weblate?cmd=changeset=db314fe62db9 description: Translated using Weblate (French) Currently translated at 100.0% (310 of 310 strings) Translation: Tryton/account_invoice Translate-URL: https://translate.tryton.org/projects/tryton/account_invoice/fr/ diffstat: modules/account_invoice/locale/fr.po | 12 +--- 1 files changed, 5 insertions(+), 7 deletions(-) diffs (49 lines): diff -r 90b63a52042a -r db314fe62db9 modules/account_invoice/locale/fr.po --- a/modules/account_invoice/locale/fr.po Wed Apr 06 22:26:06 2022 + +++ b/modules/account_invoice/locale/fr.po Thu Apr 07 22:33:10 2022 + @@ -1,13 +1,13 @@ # msgid "" msgstr "" -"PO-Revision-Date: 2021-10-26 08:08+\n" +"PO-Revision-Date: 2022-04-08 23:16+\n" "Last-Translator: Cédric Krier \n" "Language: fr\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.8.1\n" +"X-Generator: Weblate 4.11.2\n" msgctxt "field:account.configuration,default_customer_payment_term:" msgid "Default Customer Payment Term" @@ -898,15 +898,14 @@ "Pour poster la facture « %(invoice)s », vous devez définir une séquence sur " "l'année fiscale « %(fiscalyear)s »." -#, fuzzy msgctxt "model:ir.message,text:msg_invoice_number_after" msgid "" "To number the invoice \"%(invoice)s\", you must set an invoice date after " "\"%(date)s\" because the sequence \"%(sequence)s\" has already been used for " "invoice \"%(after_invoice)s\"." msgstr "" -"Pour numéroter la facture « %(invoice)s », vous devez définir une date " -"comptable après « %(date)s » car la séquence « %(sequence)s » a déjà été " +"Pour numéroter la facture « %(invoice)s », vous devez définir une date de " +"facturation après « %(date)s » car la séquence « %(sequence)s » a déjà été " "utilisée pour la facture « %(after_invoice)s »." msgctxt "model:ir.message,text:msg_invoice_overpay_paid" @@ -959,10 +958,9 @@ "Vous ne pouvez pas utiliser le même compte « %(account)s » pour la facture " "« %(invoice)s » et pour la ligne « %(lines)s »." -#, fuzzy msgctxt "model:ir.message,text:msg_invoice_similar" msgid "The invoice \"%(invoice)s\" is similar to invoice \"%(similar)s\"." -msgstr "La facture « %(invoice)s » a une date de facture dans le futur." +msgstr "La facture « %(invoice)s » est similaire à la facture « %(similar)s »." msgctxt "model:ir.message,text:msg_invoice_tax_create" msgid ""
[tryton-commits] changeset in trytond:default Clean import
changeset 4abfe1a26578 in trytond:default details: https://hg.tryton.org/trytond?cmd=changeset=4abfe1a26578 description: Clean import diffstat: trytond/model/fields/reference.py | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diffs (19 lines): diff -r c5655dd9a3b9 -r 4abfe1a26578 trytond/model/fields/reference.py --- a/trytond/model/fields/reference.py Sat Apr 09 00:05:27 2022 +0200 +++ b/trytond/model/fields/reference.py Sat Apr 09 00:00:16 2022 +0200 @@ -8,12 +8,12 @@ from trytond.pool import Pool from trytond.pyson import PYSONEncoder from trytond.rpc import RPC +from trytond.tools import cached_property from trytond.transaction import Transaction -from trytond.tools import cached_property from .field import ( -Field, context_validate, domain_validate, get_eval_fields, -instantiate_context, search_order_validate, with_inactive_records) +Field, context_validate, domain_validate, instantiate_context, +search_order_validate, with_inactive_records) from .selection import SelectionMixin
[tryton-commits] changeset in trytond:default Add datetime_field, filename and di...
changeset c5655dd9a3b9 in trytond:default details: https://hg.tryton.org/trytond?cmd=changeset=c5655dd9a3b9 description: Add datetime_field, filename and digits to display_depends issue11134 diffstat: trytond/model/fields/binary.py| 14 -- trytond/model/fields/float.py | 6 -- trytond/model/fields/many2many.py | 12 +++- trytond/model/fields/many2one.py | 14 -- trytond/model/fields/one2many.py | 12 +++- 5 files changed, 30 insertions(+), 28 deletions(-) diffs (150 lines): diff -r 5ffe1365040e -r c5655dd9a3b9 trytond/model/fields/binary.py --- a/trytond/model/fields/binary.pyFri Apr 08 21:56:25 2022 +0200 +++ b/trytond/model/fields/binary.pySat Apr 09 00:05:27 2022 +0200 @@ -3,7 +3,7 @@ from sql import Column, Null from trytond.filestore import filestore -from trytond.tools import grouped_slice, reduce_ids +from trytond.tools import cached_property, grouped_slice, reduce_ids from trytond.transaction import Transaction from .field import Field @@ -22,11 +22,6 @@ on_change_with=None, depends=None, context=None, loading='lazy', filename=None, file_id=None, store_prefix=None): self.filename = filename -if filename is not None: -if depends is None: -depends = [filename] -else: -depends.append(filename) self.file_id = file_id self.store_prefix = store_prefix super(Binary, self).__init__(string=string, help=help, @@ -34,6 +29,13 @@ select=select, on_change=on_change, on_change_with=on_change_with, depends=depends, context=context, loading=loading) +@cached_property +def display_depends(self): +depends = super().display_depends +if self.filename: +depends.add(self.filename) +return depends + def get(self, ids, model, name, values=None): ''' Convert the binary value into ``bytes`` diff -r 5ffe1365040e -r c5655dd9a3b9 trytond/model/fields/float.py --- a/trytond/model/fields/float.py Fri Apr 08 21:56:25 2022 +0200 +++ b/trytond/model/fields/float.py Sat Apr 09 00:05:27 2022 +0200 @@ -42,12 +42,6 @@ :param digits: a list of two integers defining the total of digits and the number of decimals of the float. ''' -if isinstance(digits, str): -if depends is None: -depends = [digits] -elif digits not in depends: -depends = depends.copy() -depends.append(digits) super(Float, self).__init__(string=string, help=help, required=required, readonly=readonly, domain=domain, states=states, select=select, on_change=on_change, on_change_with=on_change_with, diff -r 5ffe1365040e -r c5655dd9a3b9 trytond/model/fields/many2many.py --- a/trytond/model/fields/many2many.py Fri Apr 08 21:56:25 2022 +0200 +++ b/trytond/model/fields/many2many.py Sat Apr 09 00:05:27 2022 +0200 @@ -44,11 +44,6 @@ :param search_context: The context to use when searching for a record :param filter: A domain to filter target records. ''' -if datetime_field: -if depends: -depends.append(datetime_field) -else: -depends = [datetime_field] super(Many2Many, self).__init__(string=string, help=help, required=required, readonly=readonly, domain=domain, states=states, on_change=on_change, on_change_with=on_change_with, @@ -111,6 +106,13 @@ return self.domain @cached_property +def display_depends(self): +depends = super().display_depends +if self.datetime_field: +depends.add(self.datetime_field) +return depends + +@cached_property def edition_depends(self): depends = super().edition_depends depends |= get_eval_fields(self.size) diff -r 5ffe1365040e -r c5655dd9a3b9 trytond/model/fields/many2one.py --- a/trytond/model/fields/many2one.py Fri Apr 08 21:56:25 2022 +0200 +++ b/trytond/model/fields/many2one.py Sat Apr 09 00:05:27 2022 +0200 @@ -7,7 +7,7 @@ from trytond.pool import Pool from trytond.pyson import PYSONEncoder -from trytond.tools import reduce_ids +from trytond.tools import cached_property, reduce_ids from trytond.transaction import Transaction from .field import ( @@ -48,11 +48,6 @@ if ondelete not in ('CASCADE', 'RESTRICT', 'SET NULL'): raise Exception('Bad arguments') self.ondelete = ondelete -if datetime_field: -if depends: -depends.append(datetime_field) -else: -depends = [datetime_field] super(Many2One, self).__init__(string=string, help=help, required=required, readonly=readonly, domain=domain, states=states, select=select, on_change=on_change,
[tryton-commits] changeset in modules/sale_payment:default Do not append to depen...
changeset d019ce42c411 in modules/sale_payment:default details: https://hg.tryton.org/modules/sale_payment?cmd=changeset=d019ce42c411 description: Do not append to depends evaluated field from domain issue11134 diffstat: account.py | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diffs (12 lines): diff -r a7365169d053 -r d019ce42c411 account.py --- a/account.pyFri Apr 08 19:07:14 2022 +0200 +++ b/account.pySat Apr 09 00:02:57 2022 +0200 @@ -39,8 +39,6 @@ ('state', '!=', 'cancelled'), ()), ] -if 'state' not in cls.origin.depends: -cls.origin.depends.append('state') @classmethod def _get_origin(cls):
[tryton-commits] changeset in modules/account_statement:default Do not use depend...
changeset bd763f692212 in modules/account_statement:default details: https://hg.tryton.org/modules/account_statement?cmd=changeset=bd763f692212 description: Do not use depends to prevent duplicate states from mixin fields issue11134 diffstat: statement.py | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diffs (20 lines): diff -r d44fa6c38b54 -r bd763f692212 statement.py --- a/statement.py Fri Apr 08 19:07:12 2022 +0200 +++ b/statement.py Sat Apr 09 00:04:13 2022 +0200 @@ -773,11 +773,11 @@ @classmethod def __setup__(cls): super(Line, cls).__setup__() -if 'origin' not in cls.date.depends: -cls.date.states.update({ -'readonly': (cls.date.states['readonly'] -| Bool(Eval('origin', 0))), -}) +cls.date.states = { +'readonly': ( +(Eval('statement_state') != 'draft') +| Bool(Eval('origin', 0))), +} cls.account.required = True t = cls.__table__() cls._sql_constraints += [
[tryton-commits] changeset in modules/account_payment_clearing:default Do not app...
changeset fbeef8bf8722 in modules/account_payment_clearing:default details: https://hg.tryton.org/modules/account_payment_clearing?cmd=changeset=fbeef8bf8722 description: Do not append to depends evaluated field from domain issue11134 diffstat: statement.py | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diffs (13 lines): diff -r ddf5a5c7cec2 -r fbeef8bf8722 statement.py --- a/statement.py Fri Apr 08 19:07:12 2022 +0200 +++ b/statement.py Sat Apr 09 00:02:57 2022 +0200 @@ -102,9 +102,6 @@ ('company', '=', Eval('company', -1)), ('currency', '=', Eval('currency', -1)) ] -for fname in ['company', 'currency']: -if fname not in cls.related_to.depends: -cls.related_to.depends.append(fname) @classmethod def _get_relations(cls):
[tryton-commits] changeset in modules/account_payment:default Do not append to de...
changeset 5b7872e3afc0 in modules/account_payment:default details: https://hg.tryton.org/modules/account_payment?cmd=changeset=5b7872e3afc0 description: Do not append to depends evaluated field from domain issue11134 diffstat: account.py | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diffs (13 lines): diff -r 42f15d274878 -r 5b7872e3afc0 account.py --- a/account.pyFri Apr 08 19:07:12 2022 +0200 +++ b/account.pySat Apr 09 00:02:57 2022 +0200 @@ -587,9 +587,6 @@ cls.related_to.search_context.update({ 'amount_order': Eval('amount', 0), }) -for field in ['company', 'party', 'currency', 'amount']: -if field not in cls.related_to.depends: -cls.related_to.depends.append(field) @classmethod def _get_relations(cls):
[tryton-commits] changeset in trytond:default Import cached_property from trytond...
changeset 5ffe1365040e in trytond:default details: https://hg.tryton.org/trytond?cmd=changeset=5ffe1365040e description: Import cached_property from trytond tools diffstat: trytond/model/fields/date.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (17 lines): diff -r 4ceb8ad07bd5 -r 5ffe1365040e trytond/model/fields/date.py --- a/trytond/model/fields/date.py Fri Apr 08 19:07:14 2022 +0200 +++ b/trytond/model/fields/date.py Fri Apr 08 21:56:25 2022 +0200 @@ -1,12 +1,12 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. import datetime -from functools import cached_property from sql.functions import AtTimeZone, Function from trytond import backend from trytond.pyson import PYSON, PYSONEncoder +from trytond.tools import cached_property from .field import Field, get_eval_fields
[tryton-commits] changeset in trytond:default Send only the required fields when ...
changeset 4ceb8ad07bd5 in trytond:default details: https://hg.tryton.org/trytond?cmd=changeset=4ceb8ad07bd5 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: CHANGELOG | 3 +++ doc/ref/fields.rst| 17 - trytond/ir/email_.py | 2 +- trytond/model/active.py | 2 -- trytond/model/fields/date.py | 19 +-- trytond/model/fields/field.py | 26 +++--- trytond/model/fields/float.py | 22 +- trytond/model/fields/many2many.py | 19 --- trytond/model/fields/one2many.py | 18 +++--- trytond/model/fields/reference.py | 17 ++--- trytond/model/modelstorage.py | 7 +++ trytond/model/modelview.py| 24 ++-- trytond/tests/modelview.py| 16 trytond/tests/modelview.xml | 24 trytond/tests/test_modelview.py | 22 ++ trytond/tests/test_tryton.py | 21 ++--- 16 files changed, 207 insertions(+), 52 deletions(-) diffs (543 lines): diff -r 7df5f88c1e60 -r 4ceb8ad07bd5 CHANGELOG --- a/CHANGELOG Fri Apr 08 09:55:23 2022 +0200 +++ b/CHANGELOG Fri Apr 08 19:07:14 2022 +0200 @@ -1,3 +1,6 @@ +* Use a set for field's depends +* Relax the constraint on a field's depends +* Include only needed fields when fetching a view definition * Make warning check re-entrant * Manage DatabaseDataError in ModelSQL * Remove support for pysqlite2 diff -r 7df5f88c1e60 -r 4ceb8ad07bd5 doc/ref/fields.rst --- a/doc/ref/fields.rstFri Apr 08 09:55:23 2022 +0200 +++ b/doc/ref/fields.rstFri Apr 08 19:07:14 2022 +0200 @@ -112,13 +112,28 @@ .. attribute:: Field.depends - A list of field names on which the field depends. + A :py:class:`set` of extra field names on which the field depends. This means that the client read also these fields even if they are not defined on the view. :attr:`Field.depends` is used for example to ensure that :class:`~trytond.pyson.PYSON` statement could be evaluated. +.. attribute:: Field.display_depends + + A computed set of field names on which the field depends when being + displayed in a read only view. + +.. attribute:: Field.edition_depends + + A computed set of field names on which the field depends when being + displayed in a writable view. + +.. attribute:: Field.validation_depends + + A computed set of field names on which the field depends when being + validated. + .. attribute:: Field.context A dictionary which updates the current context for *relation field*. diff -r 7df5f88c1e60 -r 4ceb8ad07bd5 trytond/ir/email_.py --- a/trytond/ir/email_.py Fri Apr 08 09:55:23 2022 +0200 +++ b/trytond/ir/email_.py Fri Apr 08 19:07:14 2022 +0200 @@ -332,7 +332,7 @@ ], ] ] -field.depends.append('model') +field.depends.add('model') cls.__rpc__.update({ 'get': RPC(instantiate=0), 'get_default': RPC(), diff -r 7df5f88c1e60 -r 4ceb8ad07bd5 trytond/model/active.py --- a/trytond/model/active.py Fri Apr 08 09:55:23 2022 +0200 +++ b/trytond/model/active.py Fri Apr 08 19:07:14 2022 +0200 @@ -32,8 +32,6 @@ field.states['readonly'] |= inactive else: field.states['readonly'] = inactive -if 'active' not in field.depends: -field.depends.append('active') if issubclass(cls, ModelView): for states in cls._buttons.values(): diff -r 7df5f88c1e60 -r 4ceb8ad07bd5 trytond/model/fields/date.py --- a/trytond/model/fields/date.py Fri Apr 08 09:55:23 2022 +0200 +++ b/trytond/model/fields/date.py Fri Apr 08 19:07:14 2022 +0200 @@ -1,13 +1,14 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. import datetime +from functools import cached_property from sql.functions import AtTimeZone, Function from trytond import backend -from trytond.pyson import PYSONEncoder +from trytond.pyson import PYSON, PYSONEncoder -from .field import Field +from .field import Field, get_eval_fields class SQLite_Date(Function): @@ -59,6 +60,20 @@ definition['format'] = encoder.encode(self.format) return definition +@cached_property +def display_depends(self): +depends = super().display_depends +if isinstance(self.format, PYSON): +depends |= get_eval_fields(self.format) +return depends + +@cached_property +def validation_depends(self): +depends = super().display_depends +if isinstance(self.format, PYSON): +depends |=
[tryton-commits] changeset in modules/web_user:default Send only the required fie...
changeset 784cb76aff7a in modules/web_user:default details: https://hg.tryton.org/modules/web_user?cmd=changeset=784cb76aff7a description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: user.py | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diffs (13 lines): diff -r 00d3db4a79c3 -r 784cb76aff7a user.py --- a/user.py Fri Apr 08 09:46:11 2022 +0200 +++ b/user.py Fri Apr 08 19:07:14 2022 +0200 @@ -72,8 +72,7 @@ email = fields.Char('E-mail', select=True, states={ 'required': Eval('active', True), -}, -depends=['active']) +}) email_valid = fields.Boolean('E-mail Valid') email_token = fields.Char('E-mail Token', select=True) password_hash = fields.Char('Password Hash')
[tryton-commits] changeset in modules/web_shop_vue_storefront:default Send only t...
changeset 04573aa647ee in modules/web_shop_vue_storefront:default details: https://hg.tryton.org/modules/web_shop_vue_storefront?cmd=changeset=04573aa647ee description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: party.py | 3 +-- web.py | 6 ++ 2 files changed, 3 insertions(+), 6 deletions(-) diffs (34 lines): diff -r 36f7c33e8c9a -r 04573aa647ee party.py --- a/party.py Wed Apr 06 23:37:45 2022 +0200 +++ b/party.py Fri Apr 08 19:07:14 2022 +0200 @@ -36,8 +36,7 @@ domain=[ ('party', '=', Eval('party', -1)), ('type', 'in', ['phone', 'mobile']), -], -depends=['party']) +]) def get_vsf(self, for_party=None): if for_party and for_party != self.party: diff -r 36f7c33e8c9a -r 04573aa647ee web.py --- a/web.pyWed Apr 06 23:37:45 2022 +0200 +++ b/web.pyFri Apr 08 19:07:14 2022 +0200 @@ -82,15 +82,13 @@ states={ 'required': Eval('type') == 'vsf', 'invisible': Eval('type') != 'vsf', -}, -depends=['type']) +}) vsf_elasticsearch_index = fields.Char( "Elasticsearch Index", states={ 'required': Eval('type') == 'vsf', 'invisible': Eval('type') != 'vsf', -}, -depends=['type']) +}) @classmethod def __setup__(cls):
[tryton-commits] changeset in modules/web_shop_shopify:default Send only the requ...
changeset 9e0083eba168 in modules/web_shop_shopify:default details: https://hg.tryton.org/modules/web_shop_shopify?cmd=changeset=9e0083eba168 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 12 web.py | 19 +++ 2 files changed, 11 insertions(+), 20 deletions(-) diffs (101 lines): diff -r 631a1eb1c574 -r 9e0083eba168 product.py --- a/product.pyWed Apr 06 23:37:45 2022 +0200 +++ b/product.pyFri Apr 08 19:07:14 2022 +0200 @@ -75,7 +75,7 @@ 'readonly': Bool(Eval('shopify_identifiers', [-1])), 'invisible': ~Eval('salable', False), }, -depends=['default_uom_category', 'shopify_identifiers', 'salable']) +depends={'default_uom_category'}) @classmethod def __setup__(cls): @@ -89,7 +89,6 @@ ('category', 'in', [Eval(c, -1) for c in categories]), ('digits', '=', 0), ] -cls.shopify_uom.depends.extend(categories) @classmethod def _shopify_uom_categories(cls): @@ -471,8 +470,7 @@ If(Eval('shopify_option3'), ('id', '!=', Eval('shopify_option3')), ()), -], -depends=['attributes', 'shopify_option2', 'shopify_option3']) +]) shopify_option2 = fields.Many2One( 'product.attribute', "Option 2", domain=[ @@ -486,8 +484,7 @@ ], states={ 'invisible': ~Eval('shopify_option1'), -}, -depends=['attributes', 'shopify_option1', 'shopify_option3']) +}) shopify_option3 = fields.Many2One( 'product.attribute', "Option 3", domain=[ @@ -501,8 +498,7 @@ ], states={ 'invisible': ~Eval('shopify_option2'), -}, -depends=['attributes', 'shopify_option1', 'shopify_option2']) +}) @classmethod def __setup__(cls): diff -r 631a1eb1c574 -r 9e0083eba168 web.py --- a/web.pyWed Apr 06 23:37:45 2022 +0200 +++ b/web.pyFri Apr 08 19:07:14 2022 +0200 @@ -32,32 +32,28 @@ 'required': Eval('type') == 'shopify', 'invisible': Eval('type') != 'shopify', } -_depends = ['type'] -shopify_url = fields.Char("Shop URL", states=_states, depends=_depends) +shopify_url = fields.Char("Shop URL", states=_states) shopify_version = fields.Selection( -'get_shopify_versions', "Version", states=_states, depends=_depends) -shopify_password = fields.Char( -"Password", states=_states, depends=_depends) +'get_shopify_versions', "Version", states=_states) +shopify_password = fields.Char("Password", states=_states) shopify_webhook_shared_secret = fields.Char( "Webhook Shared Secret", states={ 'invisible': _states['invisible'], -}, -depends=_depends) +}) shopify_webhook_endpoint_order = fields.Function( fields.Char( "Webhook Order Endpoint", help="The URL to be called by Shopify for Order events."), 'on_change_with_shopify_webhook_endpoint_order') shopify_warehouses = fields.One2Many( -'web.shop-stock.location', 'shop', "Warehouses", -states=_states, depends=_depends) +'web.shop-stock.location', 'shop', "Warehouses", states=_states) shopify_payment_journals = fields.One2Many( 'web.shop.shopify_payment_journal', 'shop', "Payment Journals", -states=_states, depends=_depends) +states=_states) -del _states, _depends +del _states @classmethod def __setup__(cls): @@ -69,7 +65,6 @@ field.states['invisible'] |= invisible else: field.states['invisible'] = invisible -field.depends.append('type') @classmethod def get_shopify_versions(cls):
[tryton-commits] changeset in modules/web_shop:default Send only the required fie...
changeset 31883463311b in modules/web_shop:default details: https://hg.tryton.org/modules/web_shop?cmd=changeset=31883463311b description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 1 - sale.py| 3 +-- web.py | 16 +++- 3 files changed, 8 insertions(+), 12 deletions(-) diffs (85 lines): diff -r 895c459ace78 -r 31883463311b product.py --- a/product.pyWed Apr 06 23:37:45 2022 +0200 +++ b/product.pyFri Apr 08 19:07:14 2022 +0200 @@ -25,7 +25,6 @@ states={ 'invisible': ~Eval('salable'), }, -depends=['salable'], help="The list of web shops on which the product is published.") diff -r 895c459ace78 -r 31883463311b sale.py --- a/sale.py Wed Apr 06 23:37:45 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -21,8 +21,7 @@ states={ 'required': Bool(Eval('web_shop')), 'readonly': ~Eval('web_id'), -}, -depends=['web_shop']) +}) @classmethod def __setup__(cls): diff -r 895c459ace78 -r 31883463311b web.py --- a/web.pyWed Apr 06 23:37:45 2022 +0200 +++ b/web.pyFri Apr 08 19:07:14 2022 +0200 @@ -69,7 +69,7 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) products = fields.Many2Many( 'web.shop-product.product', 'shop', 'product', "Products", @@ -79,14 +79,14 @@ context={ 'company': Eval('company', -1), }, -depends=['company'], +depends={'company'}, help="The list of products to publish.") products_removed = Many2ManyInactive( 'web.shop-product.product', 'shop', 'product', "Products Removed", context={ 'company': Eval('company', -1), }, -depends=['company'], +depends={'company'}, help="The list of products to unpublish.") categories = fields.Many2Many( @@ -94,14 +94,14 @@ context={ 'company': Eval('company', -1), }, -depends=['company'], +depends={'company'}, help="The list of categories to publish.") categories_removed = Many2ManyInactive( 'web.shop-product.category', 'shop', 'category', "Categories Removed", context={ 'company': Eval('company', -1), }, -depends=['company'], +depends={'company'}, help="The list of categories to unpublish.") _name_cache = Cache('web.shop.name', context=False) @@ -325,12 +325,10 @@ domain=['OR', ('party', '=', Eval('party', -1)), ('party', 'in', Eval('secondary_parties', [])), -], -depends=['party', 'secondary_parties']) +]) shipment_address = fields.Many2One( 'party.address', "Shipment Address", domain=['OR', ('party', '=', Eval('party', -1)), ('party', 'in', Eval('secondary_parties', [])), -], -depends=['party', 'secondary_parties']) +])
[tryton-commits] changeset in modules/user_role:default Send only the required fi...
changeset bca0085906ce in modules/user_role:default details: https://hg.tryton.org/modules/user_role?cmd=changeset=bca0085906ce description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: res.py | 6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diffs (22 lines): diff -r f118b84951b9 -r bca0085906ce res.py --- a/res.pyWed Apr 06 23:37:45 2022 +0200 +++ b/res.pyFri Apr 08 19:07:14 2022 +0200 @@ -98,16 +98,14 @@ If(Eval('from_date') & Eval('to_date'), ('from_date', '<=', Eval('to_date', None)), ()), -], -depends=['to_date']) +]) to_date = fields.Date( "To Date", domain=[ If(Eval('from_date') & Eval('to_date'), ('to_date', '>=', Eval('from_date', None)), ()), -], -depends=['from_date']) +]) @classmethod def __setup__(cls):
[tryton-commits] changeset in modules/timesheet:default Send only the required fi...
changeset 8294ff41a637 in modules/timesheet:default details: https://hg.tryton.org/modules/timesheet?cmd=changeset=8294ff41a637 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: line.py | 3 --- work.py | 4 2 files changed, 0 insertions(+), 7 deletions(-) diffs (61 lines): diff -r cbb75a7bbe60 -r 8294ff41a637 line.py --- a/line.py Wed Apr 06 23:37:44 2022 +0200 +++ b/line.py Fri Apr 08 19:07:14 2022 +0200 @@ -34,7 +34,6 @@ ('end_date', '>=', Eval('date', None)), ], ], -depends=['company', 'date'], help="The employee who spends the time.") date = fields.Date('Date', required=True, select=True, help="When the time is spent.") @@ -51,7 +50,6 @@ ('timesheet_end_date', '>=', Eval('date', None)), ], ], -depends=['date', 'company'], help="The work on which the time is spent.") description = fields.Char('Description', help="Additional description of the work done.") @@ -177,7 +175,6 @@ ('end_date', '>=', Eval('date', None)), ], ], -depends=['date'], help="The employee who spends the time.") date = fields.Date('Date', required=True, help="When the time is spent.") diff -r cbb75a7bbe60 -r 8294ff41a637 work.py --- a/work.py Wed Apr 06 23:37:44 2022 +0200 +++ b/work.py Fri Apr 08 19:07:14 2022 +0200 @@ -24,14 +24,12 @@ 'invisible': Bool(Eval('origin')), 'required': ~Eval('origin'), }, -depends=['origin'], help="The main identifier of the work.") origin = fields.Reference('Origin', selection='get_origin', states={ 'invisible': Bool(Eval('name')), 'required': ~Eval('name'), }, -depends=['name'], help="Use to relate the time spent to other records.") duration = fields.Function(fields.TimeDelta('Timesheet Duration', 'company_work_time', help="Total time spent on this work."), @@ -42,7 +40,6 @@ ('timesheet_start_date', '<=', Eval('timesheet_end_date')), ()), ], -depends=['timesheet_end_date'], help="Restrict adding lines before the date.") timesheet_end_date = fields.Date('Timesheet End', domain=[ @@ -50,7 +47,6 @@ ('timesheet_end_date', '>=', Eval('timesheet_start_date')), ()), ], -depends=['timesheet_start_date'], help="Restrict adding lines after the date.") company = fields.Many2One('company.company', 'Company', required=True, select=True, help="Make the work belong to the company.")
[tryton-commits] changeset in modules/stock_supply_production:default Send only t...
changeset e62a415e9559 in modules/stock_supply_production:default details: https://hg.tryton.org/modules/stock_supply_production?cmd=changeset=e62a415e9559 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diffs (12 lines): diff -r 6edaaba16b00 -r e62a415e9559 stock.py --- a/stock.py Thu Apr 07 00:06:34 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -22,8 +22,6 @@ ('producible', '=', True), ()), ] -if 'type' not in cls.product.depends: -cls.product.depends.append('type') cls.warehouse_location.states['invisible'] &= ( Eval('type') != 'production')
[tryton-commits] changeset in modules/stock_supply:default Send only the required...
changeset 8d07467c9b63 in modules/stock_supply:default details: https://hg.tryton.org/modules/stock_supply?cmd=changeset=8d07467c9b63 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: location.py| 2 -- order_point.py | 23 --- 2 files changed, 8 insertions(+), 17 deletions(-) diffs (99 lines): diff -r 0fb7b188fb26 -r 8d07467c9b63 location.py --- a/location.py Thu Apr 07 00:06:34 2022 +0200 +++ b/location.py Fri Apr 08 19:07:14 2022 +0200 @@ -18,7 +18,6 @@ domain=[ ('type', 'in', ['storage', 'view']), ], -depends=['type'], help='Leave empty for no default provisioning.') overflowing_location = fields.Many2One('stock.location', 'Overflowing Location', @@ -28,7 +27,6 @@ domain=[ ('type', 'in', ['storage', 'view']), ], -depends=['type'], help='Leave empty for no default overflowing.') diff -r 0fb7b188fb26 -r 8d07467c9b63 order_point.py --- a/order_point.pyThu Apr 07 00:06:34 2022 +0200 +++ b/order_point.pyFri Apr 08 19:07:14 2022 +0200 @@ -30,23 +30,21 @@ context={ 'company': Eval('company', -1), }, -depends=['type', 'company']) +depends={'company'}) warehouse_location = fields.Many2One('stock.location', 'Warehouse Location', select=True, domain=[('type', '=', 'warehouse')], states={ 'invisible': Not(Equal(Eval('type'), 'purchase')), 'required': Equal(Eval('type'), 'purchase'), -}, -depends=['type']) +}) storage_location = fields.Many2One('stock.location', 'Storage Location', select=True, domain=[('type', '=', 'storage')], states={ 'invisible': Not(Equal(Eval('type'), 'internal')), 'required': Equal(Eval('type'), 'internal'), -}, -depends=['type']) +}) location = fields.Function(fields.Many2One('stock.location', 'Location'), 'get_location', searcher='search_location') provisioning_location = fields.Many2One( @@ -56,8 +54,7 @@ 'invisible': Not(Equal(Eval('type'), 'internal')), 'required': ((Eval('type') == 'internal') & (Eval('min_quantity', None) != None)), # noqa: E711 -}, -depends=['type', 'min_quantity']) +}) overflowing_location = fields.Many2One( 'stock.location', 'Overflowing Location', domain=[('type', 'in', ['storage', 'view'])], @@ -65,8 +62,7 @@ 'invisible': Eval('type') != 'internal', 'required': ((Eval('type') == 'internal') & (Eval('max_quantity', None) != None)), # noqa: E711 -}, -depends=['type', 'max_quantity']) +}) type = fields.Selection( [('internal', 'Internal'), ('purchase', 'Purchase')], @@ -80,8 +76,7 @@ domain=['OR', ('min_quantity', '=', None), ('min_quantity', '<=', Eval('target_quantity', 0)), -], -depends=['target_quantity', 'type']) +]) target_quantity = fields.Float( "Target Quantity", digits='unit', required=True, domain=[ @@ -93,8 +88,7 @@ ('max_quantity', '=', None), ('target_quantity', '<=', Eval('max_quantity', 0)), ], -], -depends=['min_quantity', 'max_quantity']) +]) max_quantity = fields.Float( "Maximal Quantity", digits='unit', states={ @@ -103,8 +97,7 @@ domain=['OR', ('max_quantity', '=', None), ('max_quantity', '>=', Eval('target_quantity', 0)), -], -depends=['type', 'target_quantity']) +]) company = fields.Many2One('company.company', 'Company', required=True, domain=[ ('id', If(In('company', Eval('context', {})), '=', '!='),
[tryton-commits] changeset in modules/stock_split:default Send only the required ...
changeset 0ee8bce1756e in modules/stock_split:default details: https://hg.tryton.org/modules/stock_split?cmd=changeset=0ee8bce1756e description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diffs (20 lines): diff -r 60c1b5038a7f -r 0ee8bce1756e stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -82,8 +82,7 @@ uom = fields.Many2One('product.uom', 'Uom', required=True, domain=[ ('category', '=', Eval('uom_category')), -], -depends=['uom_category']) +]) uom_category = fields.Many2One('product.uom.category', 'Uom Category', readonly=True) @@ -194,6 +193,5 @@ moves = fields.Many2Many( 'stock.move', None, None, "Moves", domain=[('id', 'in', Eval('domain_moves'))], -depends=['domain_moves'], help="The selected moves will be sent in the new shipment.") domain_moves = fields.Many2Many('stock.move', None, None, "Domain Moves")
[tryton-commits] changeset in modules/stock_shipment_measurements:default Send on...
changeset 959e711bcf2e in modules/stock_shipment_measurements:default details: https://hg.tryton.org/modules/stock_shipment_measurements?cmd=changeset=959e711bcf2e description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diffs (13 lines): diff -r 404e5da2f5fc -r 959e711bcf2e stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -368,8 +368,7 @@ domain=[('category', '=', Id('product', 'uom_cat_weight'))], states={ 'required': Bool(Eval('additional_weight')), -}, -depends=['additional_weight']) +}) total_weight = fields.Function( fields.Float( "Total Weight", digits='weight_uom',
[tryton-commits] changeset in modules/stock_shipment_cost:default Send only the r...
changeset 16c1f78214c1 in modules/stock_shipment_cost:default details: https://hg.tryton.org/modules/stock_shipment_cost?cmd=changeset=16c1f78214c1 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 10 +++--- 1 files changed, 3 insertions(+), 7 deletions(-) diffs (36 lines): diff -r 03fdd68fed45 -r 16c1f78214c1 stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -30,29 +30,25 @@ carrier = fields.Many2One('carrier', 'Carrier', states={ 'readonly': Eval('state').in_(['done', 'cancelled']), -}, -depends=['state']) +}) cost_used = fields.Function(fields.Numeric( "Cost", digits=price_digits, states={ 'invisible': Eval('cost_edit', False), -}, -depends=['cost_edit']), +}), 'on_change_with_cost_used') cost = fields.Numeric( "Cost", digits=price_digits, states={ 'invisible': ~Eval('cost_edit', False), 'readonly': Eval('state').in_(['done', 'cancelled']), -}, -depends=['state']) +}) cost_edit = fields.Boolean( "Edit Cost", states={ 'readonly': Eval('state').in_(['done', 'cancelled']), }, -depends=['state'], help="Check to edit the cost.") def _get_carrier_context(self):
[tryton-commits] changeset in modules/stock_secondary_unit:default Send only the ...
changeset 6b25aefed1a6 in modules/stock_secondary_unit:default details: https://hg.tryton.org/modules/stock_secondary_unit?cmd=changeset=6b25aefed1a6 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diffs (33 lines): diff -r 9235a2bc8d67 -r 6b25aefed1a6 stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -16,8 +16,7 @@ 'invisible': ~Eval('secondary_unit'), 'readonly': Eval('state').in_( ['cancelled', 'assigned', 'done']), -}, -depends=['secondary_unit', 'state']), +}), 'on_change_with_secondary_quantity', setter='set_secondary') secondary_unit = fields.Many2One( 'product.uom', "Secondary Unit", ondelete='RESTRICT', @@ -27,8 +26,7 @@ states={ 'invisible': ~Eval('product_secondary_uom_category'), 'readonly': Eval('state').in_(['cancelled', 'assigned', 'done']), -}, -depends=['product_secondary_uom_category', 'state']) +}) secondary_unit_price = fields.Function( Monetary( "Secondary Unit Price", currency='currency', digits=price_digits, @@ -36,8 +34,7 @@ 'invisible': (~Eval('unit_price_required') | ~Eval('secondary_unit')), 'readonly': Eval('state') != 'draft', -}, -depends=['unit_price_required', 'secondary_unit', 'state']), +}), 'on_change_with_secondary_unit_price', setter='set_secondary') product_secondary_uom_category = fields.Function(
[tryton-commits] changeset in modules/stock_quantity_issue:default Send only the ...
changeset c50097fc4f1f in modules/stock_quantity_issue:default details: https://hg.tryton.org/modules/stock_quantity_issue?cmd=changeset=c50097fc4f1f description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diffs (22 lines): diff -r c64e3cc86850 -r c50097fc4f1f stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -36,8 +36,7 @@ 'stock.shipment.internal': [ ('company', '=', Eval('company', -1)), ], -}, -depends=['company']) +}) planned_date = fields.Function( fields.Date("Planned Date"), 'on_change_with_planned_date') @@ -60,7 +59,7 @@ 'stock_skip_warehouse': False, 'stock_date_end': Eval('planned_date'), }, -depends=['company', 'warehouse', 'planned_date']) +depends={'company', 'warehouse', 'planned_date'}) processed_by = employee_field("Processed by", states=['processing']) solved_by = employee_field("Solved by", states=['solved'])
[tryton-commits] changeset in modules/stock_quantity_early_planning:default Send ...
changeset 7b62c2ccfb93 in modules/stock_quantity_early_planning:default details: https://hg.tryton.org/modules/stock_quantity_early_planning?cmd=changeset=7b62c2ccfb93 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diffs (23 lines): diff -r d62bbb9aae28 -r 7b62c2ccfb93 stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -34,8 +34,7 @@ 'stock.shipment.internal': [ ('company', '=', Eval('company', -1)), ], -}, -depends=['company']) +}) planned_date = fields.Function( fields.Date("Planned Date"), 'on_change_with_planned_date') @@ -58,8 +57,7 @@ "Earliest Percentage", digits=(1, 4), states={ 'invisible': ~Eval('earliest_date'), -}, -depends=['earliest_date']), +}), 'get_earliest_percentage') warehouse = fields.Function( fields.Many2One('stock.location', "Warehouse"),
[tryton-commits] changeset in modules/stock_product_location:default Send only th...
changeset 0606a48d4b33 in modules/stock_product_location:default details: https://hg.tryton.org/modules/stock_product_location?cmd=changeset=0606a48d4b33 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: location.py | 8 +++- product.py | 6 ++ 2 files changed, 5 insertions(+), 9 deletions(-) diffs (54 lines): diff -r e35d2fda73f6 -r 0606a48d4b33 location.py --- a/location.py Wed Apr 06 23:37:44 2022 +0200 +++ b/location.py Fri Apr 08 19:07:14 2022 +0200 @@ -19,16 +19,14 @@ If(Bool(Eval('product')), ('products', '=', Eval('product')), ()), -], -depends=['product']) +]) product = fields.Many2One( 'product.product', "Variant", ondelete='CASCADE', select=True, domain=[ If(Bool(Eval('template')), ('template', '=', Eval('template')), ()), -], -depends=['template']) +]) warehouse = fields.Many2One('stock.location', 'Warehouse', required=True, domain=[('type', '=', 'warehouse')], ondelete='CASCADE') location = fields.Many2One('stock.location', 'Storage Location', @@ -37,7 +35,7 @@ ('type', '=', 'storage'), ('parent', 'child_of', If(Bool(Eval('warehouse')), [Eval('warehouse')], [])), -], depends=['warehouse']) +]) @classmethod def __register__(cls, module_name): diff -r e35d2fda73f6 -r 0606a48d4b33 product.py --- a/product.pyWed Apr 06 23:37:44 2022 +0200 +++ b/product.pyFri Apr 08 19:07:14 2022 +0200 @@ -11,8 +11,7 @@ "Default Locations", states={ 'invisible': ~Eval('type').in_(['goods', 'assets']), -}, -depends=['type']) +}) @classmethod def copy(cls, templates, default=None): @@ -48,8 +47,7 @@ ], states={ 'invisible': ~Eval('type').in_(['goods', 'assets']), -}, -depends=['type', 'template']) +}) @classmethod def copy(cls, products, default=None):
[tryton-commits] changeset in modules/stock_package_shipping_ups:default Send onl...
changeset 4aa328383509 in modules/stock_package_shipping_ups:default details: https://hg.tryton.org/modules/stock_package_shipping_ups?cmd=changeset=4aa328383509 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: carrier.py | 12 1 files changed, 4 insertions(+), 8 deletions(-) diffs (43 lines): diff -r efe30bca2b9c -r 4aa328383509 carrier.py --- a/carrier.pyWed Apr 06 23:37:44 2022 +0200 +++ b/carrier.pyFri Apr 08 19:07:14 2022 +0200 @@ -63,8 +63,7 @@ states={ 'required': Eval('shipping_service') == 'ups', 'invisible': Eval('shipping_service') != 'ups', -}, -depends=['shipping_service']) +}) ups_label_image_format = fields.Selection([ (None, ''), ('EPL', 'EPL2'), @@ -76,8 +75,7 @@ states={ 'required': Eval('shipping_service') == 'ups', 'invisible': Eval('shipping_service') != 'ups', -}, -depends=['shipping_service']) +}) ups_label_height = fields.Selection([ (None, ''), ('6', '6'), @@ -88,8 +86,7 @@ & (Eval('ups_label_image_format') != 'GIF')), 'invisible': ((Eval('shipping_service') != 'ups') | (Eval('ups_label_image_format') == 'GIF')), -}, -depends=['shipping_service', 'ups_label_image_format']) +}) ups_notifications = fields.MultiSelection([ ('5', "Quantum View In-transit"), ('6', "Quantum View Shop"), @@ -101,8 +98,7 @@ ], "Notifications", sort=False, states={ 'invisible': Eval('shipping_service') != 'ups', -}, -depends=['shipping_service']) +}) @classmethod def __setup__(cls):
[tryton-commits] changeset in modules/stock_package_shipping_sendcloud:default Se...
changeset b77b97a3eef4 in modules/stock_package_shipping_sendcloud:default details: https://hg.tryton.org/modules/stock_package_shipping_sendcloud?cmd=changeset=b77b97a3eef4 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: carrier.py | 9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diffs (30 lines): diff -r b6fcc1bf5be4 -r b77b97a3eef4 carrier.py --- a/carrier.pyWed Apr 06 23:37:44 2022 +0200 +++ b/carrier.pyFri Apr 08 19:07:14 2022 +0200 @@ -60,14 +60,12 @@ 'carrier.sendcloud.address', 'sendcloud', "Addresses", states={ 'readonly': ~Eval('id') | (Eval('id', -1) < 0), -}, -depends=['id']) +}) shipping_methods = fields.One2Many( 'carrier.sendcloud.shipping_method', 'sendcloud', "Methods", states={ 'readonly': ~Eval('id') | (Eval('id', -1) < 0), -}, -depends=['id']) +}) _addresses_sender_cache = Cache( 'carrier.credential.sendcloud.addresses_sender', @@ -252,8 +250,7 @@ states={ 'invisible': Eval('shipping_service') != 'sendcloud', 'required': Eval('shipping_service') == 'sendcloud', -}, -depends=['shipping_service']) +}) @classmethod def __setup__(cls):
[tryton-commits] changeset in modules/stock_package_shipping_mygls:default Send o...
changeset dfb918f9ac8a in modules/stock_package_shipping_mygls:default details: https://hg.tryton.org/modules/stock_package_shipping_mygls?cmd=changeset=dfb918f9ac8a description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: carrier.py | 10 +++--- 1 files changed, 3 insertions(+), 7 deletions(-) diffs (41 lines): diff -r 8a3e96d47a26 -r dfb918f9ac8a carrier.py --- a/carrier.pyWed Apr 06 23:37:44 2022 +0200 +++ b/carrier.pyFri Apr 08 19:07:14 2022 +0200 @@ -44,8 +44,7 @@ ], "Type of Printer", sort=False, translate=False, states={ 'invisible': Eval('shipping_service') != 'mygls', -}, -depends=['shipping_service']) +}) mygls_print_position = fields.Integer( "Print Position", domain=[ @@ -58,8 +57,7 @@ 'invisible': ( (Eval('mygls_type_of_printer') != 'A4_2x2') | (Eval('shipping_service') != 'mygls')), -}, -depends=['mygls_type_of_printer', 'shipping_service']) +}) mygls_services = fields.MultiSelection([ ('24h', "Service guaranteed delivery shipment in 24 Hours"), ('AOS', "Addressee Only Service"), @@ -80,8 +78,7 @@ ], "Services", states={ 'invisible': Eval('shipping_service') != 'mygls', -}, -depends=['shipping_service']) +}) mygls_sms = fields.Char( "SMS", translate=True, @@ -89,7 +86,6 @@ 'invisible': Eval('shipping_service') != 'mygls', 'required': Eval('mygls_services', []).contains('SM1'), }, -depends=['shipping_service', 'mygls_services'], help="Variables that can be used in the text of the SMS:\n" "ParcelNr#, #COD#, #PickupDate#, #From_Name#, #ClientRef#")
[tryton-commits] changeset in modules/stock_package_shipping_dpd:default Send onl...
changeset c37274cc143c in modules/stock_package_shipping_dpd:default details: https://hg.tryton.org/modules/stock_package_shipping_dpd?cmd=changeset=c37274cc143c description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: carrier.py | 9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diffs (33 lines): diff -r e915e8f6a460 -r c37274cc143c carrier.py --- a/carrier.pyWed Apr 06 23:37:44 2022 +0200 +++ b/carrier.pyFri Apr 08 19:07:14 2022 +0200 @@ -71,8 +71,7 @@ states={ 'required': Eval('shipping_service') == 'dpd', 'invisible': Eval('shipping_service') != 'dpd', -}, -depends=['shipping_service']) +}) dpd_printer_language = fields.Selection([ (None, ''), ('PDF', "PDF"), @@ -81,8 +80,7 @@ states={ 'required': Eval('shipping_service') == 'dpd', 'invisible': Eval('shipping_service') != 'dpd', -}, -depends=['shipping_service']) +}) dpd_paper_format = fields.Selection([ (None, ''), ('A4', "A4"), @@ -92,8 +90,7 @@ states={ 'required': Eval('shipping_service') == 'dpd', 'invisible': Eval('shipping_service') != 'dpd', -}, -depends=['shipping_service']) +}) @classmethod def __setup__(cls):
[tryton-commits] changeset in modules/stock_package_shipping:default Send only th...
changeset 7f6aadaf0351 in modules/stock_package_shipping:default details: https://hg.tryton.org/modules/stock_package_shipping?cmd=changeset=7f6aadaf0351 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 21 - 1 files changed, 8 insertions(+), 13 deletions(-) diffs (70 lines): diff -r e9d2ba0c6189 -r 7f6aadaf0351 stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -27,8 +27,7 @@ class DimensionsMixin(object): __slots__ = () -length = fields.Float('Length', digits=(16, Eval('length_digits', 2)), -depends=['length_digits']) +length = fields.Float('Length', digits=(16, Eval('length_digits', 2))) length_uom = fields.Many2One('product.uom', 'Length Unit', domain=[ ('category', '=', Id('product', 'uom_cat_length')), @@ -36,11 +35,10 @@ states={ 'required': Bool(Eval('length')), }, -depends=['length', 'length_digits']) +depends={'length_digits'}) length_digits = fields.Function(fields.Integer('Length Digits'), 'on_change_with_length_digits') -height = fields.Float('Height', digits=(16, Eval('height_digits', 2)), -depends=['height_digits']) +height = fields.Float('Height', digits=(16, Eval('height_digits', 2))) height_uom = fields.Many2One('product.uom', 'Height Unit', domain=[ ('category', '=', Id('product', 'uom_cat_length')), @@ -48,11 +46,10 @@ states={ 'required': Bool(Eval('height')), }, -depends=['height', 'height_digits']) +depends={'height_digits'}) height_digits = fields.Function(fields.Integer('Height Digits'), 'on_change_with_height_digits') -width = fields.Float('Width', digits=(16, Eval('width_digits', 2)), -depends=['width_digits']) +width = fields.Float('Width', digits=(16, Eval('width_digits', 2))) width_uom = fields.Many2One('product.uom', 'Width Unit', domain=[ ('category', '=', Id('product', 'uom_cat_length')), @@ -60,7 +57,7 @@ states={ 'required': Bool(Eval('width')), }, -depends=['width', 'width_digits']) +depends={'width_digits'}) width_digits = fields.Function(fields.Integer('Width Digits'), 'on_change_with_width_digits') @@ -198,8 +195,7 @@ shipping_description = fields.Char('Shipping Description', states={ 'readonly': Eval('state').in_(['done', 'packed']) -}, -depends=['state']) +}) @classmethod def __setup__(cls): @@ -324,8 +320,7 @@ 'carrier', "Carrier", states={ 'readonly': ~Eval('state').in_(['draft', 'waiting', 'assigned']), -}, -depends=['state']) +}) @classmethod @ModelView.button
[tryton-commits] changeset in modules/stock_package:default Send only the require...
changeset c35f60a8ad8d in modules/stock_package:default details: https://hg.tryton.org/modules/stock_package?cmd=changeset=c35f60a8ad8d description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 34 ++ 1 files changed, 10 insertions(+), 24 deletions(-) diffs (123 lines): diff -r affb2684cb58 -r c35f60a8ad8d stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -46,8 +46,7 @@ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id('stock_package', 'sequence_type_package')), -], -depends=['company']) +]) @classmethod def __register__(cls, module_name): @@ -138,8 +137,7 @@ domain=[('category', '=', Id('product', 'uom_cat_weight'))], states={ 'required': Bool(Eval('packaging_weight')), -}, -depends=['packaging_weight']) +}) @fields.depends( 'packaging_volume', 'packaging_volume_uom', @@ -189,8 +187,7 @@ 'stock.package.type', "Type", required=True, states={ 'readonly': Eval('state') == 'closed', -}, -depends=['state']) +}) shipment = fields.Reference( "Shipment", selection='get_shipment', select=True, states={ @@ -203,8 +200,7 @@ 'stock.shipment.in.return': [ ('company', '=', Eval('company', -1)), ], -}, -depends=['state', 'company']) +}) moves = fields.One2Many('stock.move', 'package', 'Moves', domain=[ ('company', '=', Eval('company', -1)), @@ -220,8 +216,7 @@ ], states={ 'readonly': Eval('state') == 'closed', -}, -depends=['company', 'shipment', 'state']) +}) parent = fields.Many2One( 'stock.package', "Parent", select=True, ondelete='CASCADE', domain=[ @@ -230,8 +225,7 @@ ], states={ 'readonly': Eval('state') == 'closed', -}, -depends=['company', 'shipment', 'state']) +}) children = fields.One2Many( 'stock.package', 'parent', 'Children', domain=[ @@ -240,8 +234,7 @@ ], states={ 'readonly': Eval('state') == 'closed', -}, -depends=['company', 'shipment', 'state']) +}) state = fields.Function(fields.Selection([ ('open', "Open"), ('closed', "Closed"), @@ -374,8 +367,7 @@ ], states={ 'readonly': Eval('state') == 'cancelled', -}, -depends=['company', 'state']) +}) @property def package_path(self): @@ -409,15 +401,13 @@ packages = fields.One2Many('stock.package', 'shipment', 'Packages', domain=[ ('company', '=', Eval('company', -1)), -], -depends=['company']) +]) root_packages = fields.Function(fields.One2Many('stock.package', 'shipment', 'Packages', domain=[ ('company', '=', Eval('company', -1)), ('parent', '=', None), -], -depends=['company']), +]), 'get_root_packages', setter='set_root_packages') def get_root_packages(self, name): @@ -457,10 +447,8 @@ Eval('warehouse_storage') == Eval('warehouse_output'), Eval('state') != 'waiting', Eval('state') != 'picked') -packages_depends = ['warehouse_storage', 'warehouse_output', 'state'] for field in [cls.packages, cls.root_packages]: field.states['readonly'] = packages_readonly -field.depends.extend(packages_depends) @classmethod @ModelView.button @@ -513,10 +501,8 @@ def __setup__(cls): super().__setup__() packages_readonly = ~Eval('state').in_(['waiting', 'assigned']) -packages_depends = ['state'] for field in [cls.packages, cls.root_packages]: field.states['readonly'] = packages_readonly -field.depends.extend(packages_depends) @classmethod @ModelView.button
[tryton-commits] changeset in modules/stock_lot_unit:default Send only the requir...
changeset 9cb63f87123c in modules/stock_lot_unit:default details: https://hg.tryton.org/modules/stock_lot_unit?cmd=changeset=9cb63f87123c description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 1 - stock.py | 2 -- 2 files changed, 0 insertions(+), 3 deletions(-) diffs (30 lines): diff -r 27aee08d2f4e -r 9cb63f87123c product.py --- a/product.pyFri Apr 08 18:58:33 2022 +0200 +++ b/product.pyFri Apr 08 19:07:14 2022 +0200 @@ -16,7 +16,6 @@ states={ 'invisible': Eval('type') == 'service', }, -depends=['type', 'default_uom_category'], help="The default unit for lot.") diff -r 27aee08d2f4e -r 9cb63f87123c stock.py --- a/stock.py Fri Apr 08 18:58:33 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -17,7 +17,6 @@ domain=[ ('category', '=', Eval('product_default_uom_category', -1)), ], -depends=['product_default_uom_category'], help="The biggest unit for the lot.") unit_quantity = fields.Float( "Unit Quantity", digits='unit', @@ -25,7 +24,6 @@ 'required': Bool(Eval('unit')), 'invisible': ~Eval('unit'), }, -depends=['unit'], help="The maximal quantity for the lot.") product_default_uom_category = fields.Function(
[tryton-commits] changeset in modules/stock_lot_sled:default Send only the requir...
changeset 18f14b9083f0 in modules/stock_lot_sled:default details: https://hg.tryton.org/modules/stock_lot_sled?cmd=changeset=18f14b9083f0 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 2 -- stock.py | 6 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diffs (42 lines): diff -r 01d066cbc049 -r 18f14b9083f0 product.py --- a/product.pyWed Apr 06 23:37:44 2022 +0200 +++ b/product.pyFri Apr 08 19:07:14 2022 +0200 @@ -16,7 +16,6 @@ states={ 'invisible': Eval('shelf_life_state', 'none') == 'none', }, -depends=['shelf_life_state'], help='In number of days.') expiration_state = fields.Selection( DATE_STATE, 'Expiration State', sort=False) @@ -24,7 +23,6 @@ states={ 'invisible': Eval('expiration_state', 'none') == 'none', }, -depends=['expiration_state'], help='In number of days.') @staticmethod diff -r 01d066cbc049 -r 18f14b9083f0 stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -52,8 +52,7 @@ 'required': ( Eval('shelf_life_expiration_state', 'none') == 'required'), 'invisible': Eval('shelf_life_expiration_state', 'none') == 'none', -}, -depends=['shelf_life_expiration_state']) +}) shelf_life_expiration_state = fields.Function( fields.Selection(DATE_STATE, 'Shelf Life Expiration State'), 'on_change_with_shelf_life_expiration_state') @@ -61,8 +60,7 @@ states={ 'required': Eval('expiration_state', 'none') == 'required', 'invisible': Eval('expiration_state', 'none') == 'none', -}, -depends=['expiration_state']) +}) expiration_state = fields.Function( fields.Selection(DATE_STATE, 'Expiration State'), 'on_change_with_expiration_state')
[tryton-commits] changeset in modules/stock_lot:default Send only the required fi...
changeset 13cf1b0ce00c in modules/stock_lot:default details: https://hg.tryton.org/modules/stock_lot?cmd=changeset=13cf1b0ce00c description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 4 +--- stock.py | 19 ++- 2 files changed, 7 insertions(+), 16 deletions(-) diffs (87 lines): diff -r 8f23ae5997bd -r 13cf1b0ce00c product.py --- a/product.pyThu Apr 07 10:31:53 2022 +0200 +++ b/product.pyFri Apr 08 19:07:14 2022 +0200 @@ -45,8 +45,7 @@ help='The type of location for which lot is required.', states={ 'invisible': ~Eval('type').in_(['goods', 'assets']), -}, -depends=['type']) +}) lot_sequence = fields.Many2One( 'ir.sequence', "Lot Sequence", domain=[ @@ -55,7 +54,6 @@ states={ 'invisible': ~Eval('type').in_(['goods', 'assets']), }, -depends=['type'], help="The sequence used to automatically number lots.") @classmethod diff -r 8f23ae5997bd -r 13cf1b0ce00c stock.py --- a/stock.py Thu Apr 07 10:31:53 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -56,8 +56,7 @@ "Number", required=True, select=True, states={ 'required': ~Eval('has_sequence') | (Eval('id', -1) >= 0), -}, -depends=['has_sequence']) +}) product = fields.Many2One('product.product', 'Product', required=True) has_sequence = fields.Function( fields.Boolean("Has Sequence"), 'on_change_with_has_sequence') @@ -289,13 +288,11 @@ product = fields.Many2One('product.product', "Product") quantity = fields.Function( fields.Float( -"Quantity", digits=(16, Eval('default_uom_digits', 2)), -depends=['default_uom_digits']), +"Quantity", digits=(16, Eval('default_uom_digits', 2))), 'get_lot', searcher='search_lot') forecast_quantity = fields.Function( fields.Float( -"Forecast Quantity", digits=(16, Eval('default_uom_digits', 2)), -depends=['default_uom_digits']), +"Forecast Quantity", digits=(16, Eval('default_uom_digits', 2))), 'get_lot', searcher='search_lot') default_uom = fields.Function( fields.Many2One('product.uom', "Default UOM"), @@ -398,8 +395,7 @@ ], states={ 'readonly': Eval('state').in_(['cancelled', 'done']), -}, -depends=['state', 'product']) +}) @classmethod def __setup__(cls): @@ -526,15 +522,13 @@ ], states={ 'readonly': ~Eval('quantity_remaining', 0), -}, -depends=['product', 'quantity_remaining']) +}) duplicate_lot_number = fields.Integer( "Duplicate Lot Number", states={ 'invisible': Len(Eval('lots')) != 1, }, -depends=['lots'], help="The number of times the lot must be duplicated.") @classmethod @@ -725,8 +719,7 @@ ], states={ 'readonly': Eval('inventory_state') != 'draft', -}, -depends=['product', 'inventory_state']) +}) @classmethod def __setup__(cls):
[tryton-commits] changeset in modules/stock_location_move:default Send only the r...
changeset 0ee17ffee5d1 in modules/stock_location_move:default details: https://hg.tryton.org/modules/stock_location_move?cmd=changeset=0ee17ffee5d1 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diffs (23 lines): diff -r c3b387598941 -r 0ee17ffee5d1 stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -17,8 +17,7 @@ "Movable", select=True, states={ 'invisible': Eval('type') != 'storage', -}, -depends=['type']) +}) assigned_by = fields.Reference( "Assigned by", 'get_assigned_by', readonly=True) @@ -119,8 +118,7 @@ states={ 'readonly': (~Eval('state').in_(['request', 'draft']) | ~Eval('from_location') | ~Eval('to_location')), -}, -depends=['state', 'from_location', 'to_location']) +}) @classmethod @ModelView.button
[tryton-commits] changeset in modules/stock_forecast:default Send only the requir...
changeset a478a4910025 in modules/stock_forecast:default details: https://hg.tryton.org/modules/stock_forecast?cmd=changeset=a478a4910025 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: forecast.py | 39 +++ 1 files changed, 15 insertions(+), 24 deletions(-) diffs (123 lines): diff -r 9ca1d87bf008 -r a478a4910025 forecast.py --- a/forecast.py Wed Apr 06 23:37:44 2022 +0200 +++ b/forecast.py Fri Apr 08 19:07:14 2022 +0200 @@ -28,36 +28,31 @@ _states = { 'readonly': Not(Equal(Eval('state'), 'draft')), } -_depends = ['state'] warehouse = fields.Many2One( 'stock.location', 'Location', required=True, domain=[('type', '=', 'warehouse')], states={ 'readonly': Or(Not(Equal(Eval('state'), 'draft')), Bool(Eval('lines', [0]))), -}, -depends=['state']) +}) destination = fields.Many2One( 'stock.location', 'Destination', required=True, -domain=[('type', 'in', ['customer', 'production'])], states=_states, -depends=_depends) +domain=[('type', 'in', ['customer', 'production'])], states=_states) from_date = fields.Date( "From Date", required=True, domain=[('from_date', '<=', Eval('to_date'))], -states=_states, depends=_depends + ['to_date']) +states=_states) to_date = fields.Date( "To Date", required=True, domain=[('to_date', '>=', Eval('from_date'))], -states=_states, depends=_depends + ['from_date']) +states=_states) lines = fields.One2Many( -'stock.forecast.line', 'forecast', 'Lines', states=_states, -depends=_depends) +'stock.forecast.line', 'forecast', 'Lines', states=_states) company = fields.Many2One( 'company.company', 'Company', required=True, states={ 'readonly': Or(Not(Equal(Eval('state'), 'draft')), Bool(Eval('lines', [0]))), -}, -depends=['state']) +}) state = fields.Selection([ ('draft', "Draft"), ('done', "Done"), @@ -66,7 +61,7 @@ active = fields.Function(fields.Boolean('Active'), 'get_active', searcher='search_active') -del _states, _depends +del _states @classmethod def __setup__(cls): @@ -259,14 +254,13 @@ _states = { 'readonly': Eval('forecast_state') != 'draft', } -_depends = ['forecast_state'] product = fields.Many2One('product.product', 'Product', required=True, domain=[ ('type', '=', 'goods'), ('consumable', '=', False), ], -states=_states, depends=_depends) +states=_states) product_uom_category = fields.Function( fields.Many2One('product.uom.category', 'Product Uom Category'), 'on_change_with_product_uom_category') @@ -277,15 +271,15 @@ ('category', '!=', -1)), ], states=_states, -depends=['product', 'product_uom_category'] + _depends) +depends={'product'}) quantity = fields.Float( "Quantity", digits='uom', required=True, domain=[('quantity', '>=', 0)], -states=_states, depends=_depends) +states=_states) minimal_quantity = fields.Float( "Minimal Qty", digits='uom', required=True, domain=[('minimal_quantity', '<=', Eval('quantity'))], -states=_states, depends=['quantity'] + _depends) +states=_states) moves = fields.Many2Many('stock.forecast.line-stock.move', 'line', 'move', 'Moves', readonly=True) forecast = fields.Many2One( @@ -293,15 +287,14 @@ states={ 'readonly': ((Eval('forecast_state') != 'draft') & Bool(Eval('forecast'))), -}, -depends=['forecast_state']) +}) forecast_state = fields.Function( fields.Selection('get_forecast_states', 'Forecast State'), 'on_change_with_forecast_state') quantity_executed = fields.Function(fields.Float( "Quantity Executed", digits='uom'), 'get_quantity_executed') -del _states, _depends +del _states @classmethod def __setup__(cls): @@ -509,12 +502,10 @@ __name__ = 'stock.forecast.complete.ask' from_date = fields.Date( "From Date", required=True, -domain=[('from_date', '<', Eval('to_date'))], -depends=['to_date']) +domain=[('from_date', '<', Eval('to_date'))]) to_date = fields.Date( "To Date", required=True, -domain=[('to_date', '>', Eval('from_date'))], -depends=['from_date']) +domain=[('to_date', '>', Eval('from_date'))]) class ForecastCompleteChoose(ModelView):
[tryton-commits] changeset in modules/stock_consignment:default Send only the req...
changeset ab0666f8e5ce in modules/stock_consignment:default details: https://hg.tryton.org/modules/stock_consignment?cmd=changeset=ab0666f8e5ce description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diffs (11 lines): diff -r 562f2e9956f9 -r ab0666f8e5ce stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -17,7 +17,6 @@ states={ 'invisible': ~Eval('type').in_(['supplier', 'storage']), }, -depends=['type'], help="The party invoiced when consignment stock is used.") @classmethod
[tryton-commits] changeset in modules/stock_assign_manual:default Send only the r...
changeset 0eb578a763c1 in modules/stock_assign_manual:default details: https://hg.tryton.org/modules/stock_assign_manual?cmd=changeset=0eb578a763c1 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 4 1 files changed, 0 insertions(+), 4 deletions(-) diffs (35 lines): diff -r b21ee7b8b1f9 -r 0eb578a763c1 stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -180,7 +180,6 @@ ('quantity', '<=', Eval('move_quantity', 0)), ], ], -depends=['move_quantity'], help="The maximum quantity to assign from the place.\n" "Leave empty for the full quantity of the move.") unit = fields.Many2One('product.uom', "Unit", readonly=True) @@ -369,7 +368,6 @@ ('unassigned_quantity', '<=', Eval('move_quantity', 0)), ], ], -depends=['move_quantity'], help="The quantity to unassign") assigned_quantity = fields.Float( "Assigned Quantity", digits='unit', @@ -380,7 +378,6 @@ ('assigned_quantity', '<=', Eval('move_quantity', 0)), ], ], -depends=['move_quantity'], help="The quantity left assigned") unit = fields.Function( fields.Many2One('product.uom', "Unit"), 'on_change_with_unit') @@ -427,7 +424,6 @@ moves = fields.One2Many( 'stock.shipment.assigned.move', None, "Moves", domain=[('move.id', 'in', Eval('assigned_moves'))], -depends=['assigned_moves'], help="The moves to unassign.") assigned_moves = fields.Many2Many( 'stock.move', None, None, "Assigned Moves")
[tryton-commits] changeset in modules/stock:default Send only the required fields...
changeset b483de7e3ad8 in modules/stock:default details: https://hg.tryton.org/modules/stock?cmd=changeset=b483de7e3ad8 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: configuration.py | 18 +++-- inventory.py | 19 +++--- location.py | 20 +- move.py | 28 --- period.py | 2 +- product.py| 6 +-- shipment.py | 83 +++--- stock_reporting_margin.py | 8 +-- 8 files changed, 49 insertions(+), 135 deletions(-) diffs (859 lines): diff -r ffb276238a51 -r b483de7e3ad8 configuration.py --- a/configuration.py Wed Apr 06 23:37:44 2022 +0200 +++ b/configuration.py Fri Apr 08 19:07:14 2022 +0200 @@ -137,48 +137,42 @@ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id('stock', 'sequence_type_shipment_in')), -], -depends=['company']) +]) shipment_in_return_sequence = fields.Many2One( 'ir.sequence', "Supplier Return Shipment Sequence", required=True, domain=[ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id('stock', 'sequence_type_shipment_in_return')), -], -depends=['company']) +]) shipment_out_sequence = fields.Many2One( 'ir.sequence', "Customer Shipment Sequence", required=True, domain=[ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id('stock', 'sequence_type_shipment_out')), -], -depends=['company']) +]) shipment_out_return_sequence = fields.Many2One( 'ir.sequence', "Customer Return Shipment Sequence", required=True, domain=[ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id('stock', 'sequence_type_shipment_out_return')), -], -depends=['company']) +]) shipment_internal_sequence = fields.Many2One( 'ir.sequence', "Internal Shipment Sequence", required=True, domain=[ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id('stock', 'sequence_type_shipment_internal')), -], -depends=['company']) +]) inventory_sequence = fields.Many2One( 'ir.sequence', "Inventory Sequence", required=True, domain=[ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id('stock', 'sequence_type_inventory')), -], -depends=['company']) +]) @classmethod def __register__(cls, module_name): diff -r ffb276238a51 -r b483de7e3ad8 inventory.py --- a/inventory.py Wed Apr 06 23:37:44 2022 +0200 +++ b/inventory.py Fri Apr 08 19:07:14 2022 +0200 @@ -25,7 +25,6 @@ _states = { 'readonly': Eval('state') != 'draft', } -_depends = ['state'] number = fields.Char('Number', readonly=True, help="The main identifier for the inventory.") @@ -34,31 +33,27 @@ domain=[('type', '=', 'storage')], states={ 'readonly': (Eval('state') != 'draft') | Eval('lines', [0]), }, -depends=['state'], help="The location inventoried.") date = fields.Date('Date', required=True, states={ 'readonly': (Eval('state') != 'draft') | Eval('lines', [0]), }, -depends=['state'], help="The date of the stock count.") lines = fields.One2Many( 'stock.inventory.line', 'inventory', 'Lines', states={ 'readonly': (_states['readonly'] | ~Eval('location') | ~Eval('date')), -}, -depends=['location', 'date'] + _depends) +}) empty_quantity = fields.Selection([ (None, ""), ('keep', "Keep"), ('empty', "Empty"), -], "Empty Quantity", states=_states, depends=_depends, +], "Empty Quantity", states=_states, help="How lines without a quantity are handled.") company = fields.Many2One('company.company', 'Company', required=True, states={ 'readonly': (Eval('state') != 'draft') | Eval('lines', [0]), }, -depends=['state'], help="The company the inventory is associated with.") state = fields.Selection([ ('draft', "Draft"), @@ -67,7 +62,7 @@ ], "State", readonly=True, select=True, sort=False, help="The current state of the inventory.") -del _states, _depends +del _states @classmethod def __setup__(cls): @@ -326,12 +321,11
[tryton-commits] changeset in modules/sale_supply_production:default Send only th...
changeset dd09caf380ee in modules/sale_supply_production:default details: https://hg.tryton.org/modules/sale_supply_production?cmd=changeset=dd09caf380ee description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diffs (11 lines): diff -r 53b4790d0133 -r dd09caf380ee product.py --- a/product.pyWed Apr 06 23:37:44 2022 +0200 +++ b/product.pyFri Apr 08 19:07:14 2022 +0200 @@ -12,7 +12,6 @@ super().__setup__() cls.supply_on_sale.states['invisible'] &= ( ~Eval('producible') | ~Eval('salable')) -cls.supply_on_sale.depends.extend(['producible', 'salable']) class Product(metaclass=PoolMeta):
[tryton-commits] changeset in modules/sale_supply_drop_shipment:default Send only...
changeset ad9c5a72f13f in modules/sale_supply_drop_shipment:default details: https://hg.tryton.org/modules/sale_supply_drop_shipment?cmd=changeset=ad9c5a72f13f description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: purchase.py | 19 +++ stock.py| 29 - 2 files changed, 19 insertions(+), 29 deletions(-) diffs (167 lines): diff -r b10e54408017 -r ad9c5a72f13f purchase.py --- a/purchase.py Wed Apr 06 23:37:44 2022 +0200 +++ b/purchase.py Fri Apr 08 19:07:14 2022 +0200 @@ -26,14 +26,13 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) delivery_address = fields.Many2One('party.address', 'Delivery Address', domain=[('party', '=', Eval('customer'))], states={ 'invisible': ~Eval('customer'), 'readonly': Eval('state') != 'draft', -}, -depends=['customer', 'state']) +}) class Configuration(metaclass=PoolMeta): @@ -90,28 +89,25 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) delivery_address = fields.Many2One('party.address', 'Delivery Address', domain=[('party', '=', Eval('customer'))], states={ 'readonly': Eval('state') != 'draft', 'invisible': ~Eval('customer'), -}, -depends=['state', 'customer']) +}) drop_shipments = fields.Function(fields.Many2Many('stock.shipment.drop', None, None, "Drop Shipments", states={ 'invisible': ~Eval('customer'), -}, -depends=['customer']), +}), 'get_drop_shipments', searcher='search_drop_shipments') drop_location = fields.Many2One('stock.location', 'Drop Location', domain=[('type', '=', 'drop')], states={ 'invisible': ~Eval('customer', False), 'required': Eval('customer', False), -}, -depends=['customer']) +}) @staticmethod def default_drop_location(): @@ -203,8 +199,7 @@ drop_shipment = fields.Boolean('Drop Shipment', states={ 'invisible': ~Eval('drop_shipment_available', False), -}, -depends=['drop_shipment_available']) +}) drop_shipment_available = fields.Function( fields.Boolean("Drop Shipment Available"), 'on_change_with_drop_shipment_available') diff -r b10e54408017 -r ad9c5a72f13f stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -57,8 +57,7 @@ ('sequence_type', '=', Id('sale_supply_drop_shipment', 'sequence_type_shipment_drop')), -], -depends=['company']) +]) @classmethod def __register__(cls, module_name): @@ -99,20 +98,18 @@ states={ 'readonly': Eval('state').in_(['cancelled', 'done']), }, -depends=['state'], help="When the stock was actually sent.") planned_date = fields.Date('Planned Date', states={ 'readonly': Eval('state') != 'draft', -}, depends=['state']) +}) company = fields.Many2One('company.company', 'Company', required=True, states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) reference = fields.Char('Reference', select=1, states={ 'readonly': Eval('state') != 'draft', -}, depends=['state']) +}) supplier = fields.Many2One('party.party', 'Supplier', required=True, states={ 'readonly': (((Eval('state') != 'draft') @@ -122,13 +119,12 @@ context={ 'company': Eval('company', -1), }, -depends=['state', 'supplier', 'company']) +depends={'company'}) contact_address = fields.Many2One('party.address', 'Contact Address', states={ 'readonly': Eval('state') != 'draft', }, -domain=[('party', '=', Eval('supplier'))], -depends=['state', 'supplier']) +domain=[('party', '=', Eval('supplier'))]) customer = fields.Many2One('party.party', 'Customer', required=True, states={ 'readonly': (((Eval('state') != 'draft') @@ -138,14 +134,13 @@ context={ 'company': Eval('company', -1), }, -depends=['state', 'company']) +depends={'company'}) delivery_address = fields.Many2One('party.address', 'Delivery Address', required=True, states={ 'readonly': Eval('state') != 'draft', }, -
[tryton-commits] changeset in modules/sale_supply:default Send only the required ...
changeset 6daa8f899aa9 in modules/sale_supply:default details: https://hg.tryton.org/modules/sale_supply?cmd=changeset=6daa8f899aa9 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diffs (13 lines): diff -r 7a3df504bcb6 -r 6daa8f899aa9 product.py --- a/product.pyWed Apr 06 23:37:44 2022 +0200 +++ b/product.pyFri Apr 08 19:07:14 2022 +0200 @@ -11,8 +11,7 @@ supply_on_sale = fields.Boolean('Supply On Sale', states={ 'invisible': ~Eval('purchasable') | ~Eval('salable'), -}, -depends=['purchasable', 'salable']) +}) class Product(metaclass=PoolMeta):
[tryton-commits] changeset in modules/sale_subscription_asset:default Send only t...
changeset 17c1c977296c in modules/sale_subscription_asset:default details: https://hg.tryton.org/modules/sale_subscription_asset?cmd=changeset=17c1c977296c description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: sale.py | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diffs (21 lines): diff -r 4f450a507131 -r 17c1c977296c sale.py --- a/sale.py Wed Apr 06 23:37:44 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -83,8 +83,7 @@ & Eval('asset_lot_required')), 'invisible': ~Eval('asset_lot_required'), 'readonly': Eval('subscription_state') != 'draft', -}, -depends=['service', 'subscription_state', 'asset_lot_required']) +}) asset_lot_required = fields.Function( fields.Boolean("Asset Lot Required"), 'on_change_with_asset_lot_required') @@ -99,7 +98,6 @@ ('quantity', '=', 1), ()), ] -cls.quantity.depends.append('asset_lot') @fields.depends('service') def on_change_with_asset_lot_required(self, name=None):
[tryton-commits] changeset in modules/sale_subscription:default Send only the req...
changeset e94325afd7fb in modules/sale_subscription:default details: https://hg.tryton.org/modules/sale_subscription?cmd=changeset=e94325afd7fb description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: configuration.py | 3 +- service.py | 3 +- subscription.py | 65 ++- 3 files changed, 23 insertions(+), 48 deletions(-) diffs (241 lines): diff -r c9aaea87b083 -r e94325afd7fb configuration.py --- a/configuration.py Wed Apr 06 23:37:44 2022 +0200 +++ b/configuration.py Fri Apr 08 19:07:14 2022 +0200 @@ -38,8 +38,7 @@ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id('sale_subscription', 'sequence_type_subscription')), -], -depends=['company']) +]) @classmethod def default_subscription_sequence(cls): diff -r c9aaea87b083 -r e94325afd7fb service.py --- a/service.pyWed Apr 06 23:37:44 2022 +0200 +++ b/service.pyFri Apr 08 19:07:14 2022 +0200 @@ -18,8 +18,7 @@ consumption_delay = fields.TimeDelta("Consumption Delay", states={ 'invisible': ~Eval('consumption_recurrence'), -}, -depends=['consumption_recurrence']) +}) def get_rec_name(self, name): return self.product.rec_name diff -r c9aaea87b083 -r e94325afd7fb subscription.py --- a/subscription.py Wed Apr 06 23:37:44 2022 +0200 +++ b/subscription.py Fri Apr 08 19:07:14 2022 +0200 @@ -35,7 +35,6 @@ states={ 'readonly': (Eval('state') != 'draft') | Eval('party', True), }, -depends=['state', 'party'], help="Make the subscription belong to the company.") number = fields.Char( @@ -48,8 +47,7 @@ description = fields.Char("Description", states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) party = fields.Many2One( 'party.party', "Party", required=True, @@ -60,7 +58,6 @@ context={ 'company': Eval('company', -1), }, -depends=['state', 'company'], help="The party who subscribes.") contact = fields.Many2One( 'party.contact_mechanism', "Contact", @@ -70,7 +67,7 @@ search_context={ 'related_party': Eval('party'), }, -depends=['company', 'party']) +depends={'company', 'party'}) invoice_party = fields.Many2One('party.party', "Invoice Party", states={ 'readonly': ((Eval('state') != 'draft') @@ -82,7 +79,7 @@ search_context={ 'related_party': Eval('party'), }, -depends=['state', 'company', 'party']) +depends={'company', 'party'}) invoice_address = fields.Many2One( 'party.address', "Invoice Address", domain=[ @@ -92,30 +89,26 @@ states={ 'readonly': Eval('state') != 'draft', 'required': ~Eval('state').in_(['draft']), -}, -depends=['party', 'invoice_party', 'state']) +}) payment_term = fields.Many2One( 'account.invoice.payment_term', "Payment Term", states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) currency = fields.Many2One( 'currency.currency', "Currency", required=True, states={ 'readonly': ((Eval('state') != 'draft') | (Eval('lines', [0]) & Eval('currency', 0))), -}, -depends=['state']) +}) start_date = fields.Date( "Start Date", required=True, states={ 'readonly': ((Eval('state') != 'draft') | Eval('next_invoice_date')), -}, -depends=['state', 'next_invoice_date']) +}) end_date = fields.Date( "End Date", domain=['OR', @@ -127,36 +120,31 @@ ], states={ 'readonly': Eval('state') != 'draft', -}, -depends=['start_date', 'state']) +}) invoice_recurrence = fields.Many2One( 'sale.subscription.recurrence.rule.set', "Invoice Recurrence", required=True, states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) invoice_start_date = fields.Date("Invoice Start Date", states={ 'readonly': ((Eval('state') != 'draft') | Eval('next_invoice_date')), -}, -depends=['state', 'next_invoice_date']) +}) next_invoice_date = fields.Date( "Next Invoice Date", readonly=True, states={ 'invisible': Eval('state') != 'running', -}, -
[tryton-commits] changeset in modules/sale_shipment_cost:default Send only the re...
changeset aac31f00ca6e in modules/sale_shipment_cost:default details: https://hg.tryton.org/modules/sale_shipment_cost?cmd=changeset=aac31f00ca6e description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: sale.py | 9 - stock.py | 12 2 files changed, 8 insertions(+), 13 deletions(-) diffs (82 lines): diff -r 297e68b5e987 -r aac31f00ca6e sale.py --- a/sale.py Wed Apr 06 23:37:44 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -87,7 +87,7 @@ context={ 'company': Eval('company', -1), }, -depends=['state', 'available_carriers', 'company']) +depends={'company'}) available_carriers = fields.Function( fields.Many2Many('carrier', None, None, 'Available Carriers'), 'on_change_with_available_carriers') @@ -97,7 +97,7 @@ ('shipment', 'On Shipment'), ], 'Shipment Cost Method', states={ 'readonly': Eval('state') != 'draft', -}, depends=['state']) +}) @classmethod def __register__(cls, module): @@ -326,7 +326,7 @@ 'sale_shipment_cost.msg_sale_shipment_cost_unique'), ] # shipment_cost is needed to compute the unit_price -cls.unit_price.depends.append('shipment_cost') +cls.unit_price.depends.add('shipment_cost') @fields.depends('shipment_cost', 'unit_price') def compute_unit_price(self): @@ -404,8 +404,7 @@ "Amount with Shipment Cost Included", states={ 'invisible': ~Eval('amount'), -}, -depends=['amount']) +}) @classmethod def default_amount_shipment_cost_included(cls): diff -r 297e68b5e987 -r aac31f00ca6e stock.py --- a/stock.py Wed Apr 06 23:37:44 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -19,8 +19,7 @@ 'invisible': ( Eval('cost_edit', False) | (Eval('cost_method') != 'shipment')), -}, -depends=['cost_edit', 'cost_method']), +}), 'on_change_with_cost_sale_currency_used') cost_sale_currency = fields.Many2One( 'currency.currency', "Cost Sale Currency", @@ -30,16 +29,14 @@ | (Eval('cost_method') != 'shipment')), 'required': Bool(Eval('cost_sale')), 'readonly': Eval('state').in_(['done', 'cancelled']), -}, -depends=['cost_method', 'cost_sale', 'state']) +}) cost_sale_used = fields.Function(fields.Numeric( "Cost Sale", digits=price_digits, states={ 'invisible': ( Eval('cost_edit', False) | (Eval('cost_method') != 'shipment')), -}, -depends=['cost_edit', 'cost_method']), +}), 'on_change_with_cost_sale_used') cost_sale = fields.Numeric( "Cost Sale", digits=price_digits, @@ -48,8 +45,7 @@ ~Eval('cost_edit', False) | (Eval('cost_method') != 'shipment')), 'readonly': Eval('state').in_(['done', 'cancelled']), -}, -depends=['cost_method', 'state']) +}) cost_invoice_line = fields.Many2One('account.invoice.line', 'Cost Invoice Line', readonly=True)
[tryton-commits] changeset in modules/sale_secondary_unit:default Send only the r...
changeset 6a010315ca4c in modules/sale_secondary_unit:default details: https://hg.tryton.org/modules/sale_secondary_unit?cmd=changeset=6a010315ca4c description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 6 +- sale.py| 10 +++--- 2 files changed, 4 insertions(+), 12 deletions(-) diffs (69 lines): diff -r eb99542841ea -r 6a010315ca4c product.py --- a/product.pyWed Apr 06 23:37:44 2022 +0200 +++ b/product.pyFri Apr 08 19:07:14 2022 +0200 @@ -15,15 +15,13 @@ 'product.uom', "Sale Secondary UOM", domain=[ ('category', '!=', Eval('default_uom_category')), -], -depends=['default_uom_category']) +]) sale_secondary_uom_factor = fields.Float( "Sale Secondary UOM Factor", digits=uom_conversion_digits, states={ 'required': Bool(Eval('sale_secondary_uom')), 'invisible': ~Eval('sale_secondary_uom'), }, -depends=['sale_secondary_uom'], help="The coefficient for the formula:\n" "1 (sale unit) = coefficient (secondary unit)") sale_secondary_uom_rate = fields.Float( @@ -32,7 +30,6 @@ 'required': Bool(Eval('sale_secondary_uom')), 'invisible': ~Eval('sale_secondary_uom'), }, -depends=['sale_secondary_uom'], help="The coefficient for the formula:\n" "coefficient (sale unit) = 1 (secondary unit)") sale_secondary_uom_category = fields.Function( @@ -123,7 +120,6 @@ cls.sale_secondary_uom.states = { 'invisible': ~Eval('salable', False), } -cls.sale_secondary_uom.depends.append('salable') class Product(metaclass=PoolMeta): diff -r eb99542841ea -r 6a010315ca4c sale.py --- a/sale.py Wed Apr 06 23:37:44 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -16,8 +16,7 @@ 'invisible': ((Eval('type') != 'line') | ~Eval('secondary_unit')), 'readonly': Eval('sale_state') != 'draft', -}, -depends=['type', 'secondary_unit', 'sale_state']), +}), 'on_change_with_secondary_quantity', setter='set_secondary') secondary_unit = fields.Many2One( 'product.uom', "Secondary Unit", ondelete='RESTRICT', @@ -31,17 +30,14 @@ | (~Eval('secondary_uom_factor') & ~Eval('secondary_uom_rate'))), 'readonly': Eval('sale_state') != 'draft', -}, -depends=['product_secondary_uom_category', 'type', -'secondary_uom_factor', 'secondary_uom_rate', 'sale_state']) +}) secondary_unit_price = fields.Function(Monetary( "Secondary Unit Price", currency='currency', digits=price_digits, states={ 'invisible': ((Eval('type') != 'line') | ~Eval('secondary_unit')), 'readonly': Eval('sale_state') != 'draft', -}, -depends=['type', 'secondary_unit', 'sale_state']), +}), 'on_change_with_secondary_unit_price', setter='set_secondary') secondary_uom_factor = fields.Float("Secondary UOM Factor")
[tryton-commits] changeset in modules/sale_promotion_coupon:default Send only the...
changeset 9642cc97ece8 in modules/sale_promotion_coupon:default details: https://hg.tryton.org/modules/sale_promotion_coupon?cmd=changeset=9642cc97ece8 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: sale.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r c19ca45b0529 -r 9642cc97ece8 sale.py --- a/sale.py Wed Apr 06 23:37:44 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -185,7 +185,7 @@ states={ 'readonly': Eval('state') != 'draft', }, -depends=['state', 'company', 'party']) +depends={'party'}) @classmethod @ModelView.button
[tryton-commits] changeset in modules/sale_promotion:default Send only the requir...
changeset cdc61cf9044e in modules/sale_promotion:default details: https://hg.tryton.org/modules/sale_promotion?cmd=changeset=cdc61cf9044e description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: sale.py | 24 +--- 1 files changed, 9 insertions(+), 15 deletions(-) diffs (77 lines): diff -r c51f1e13ee9f -r cdc61cf9044e sale.py --- a/sale.py Wed Apr 06 23:37:44 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -79,7 +79,7 @@ domain=[ ('company', '=', Eval('_parent_sale', {}).get('company', -1)), ], -depends=['sale']) +depends={'sale'}) class Promotion( @@ -99,56 +99,50 @@ datetime.date.max, Eval('end_date', datetime.date.max))), ('start_date', '=', None), -], -depends=['end_date']) +]) end_date = fields.Date('End Date', domain=['OR', ('end_date', '>=', If(~Eval('start_date', None), datetime.date.min, Eval('start_date', datetime.date.min))), ('end_date', '=', None), -], -depends=['start_date']) +]) price_list = fields.Many2One('product.price_list', 'Price List', ondelete='CASCADE', domain=[ ('company', '=', Eval('company', -1)), -], -depends=['company']) +]) amount = Monetary("Amount", currency='currency', digits='currency') currency = fields.Many2One( 'currency.currency', "Currency", states={ 'required': Bool(Eval('amount', 0)), -}, -depends=['amount']) +}) untaxed_amount = fields.Boolean( "Untaxed Amount", states={ 'invisible': ~Eval('amount'), -}, -depends=['amount']) +}) quantity = fields.Float('Quantity', digits='unit') unit = fields.Many2One('product.uom', 'Unit', states={ 'required': Bool(Eval('quantity', 0)), -}, -depends=['quantity']) +}) products = fields.Many2Many( 'sale.promotion-product.product', 'promotion', 'product', "Products", context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) categories = fields.Many2Many( 'sale.promotion-product.category', 'promotion', 'category', "Categories", context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) formula = fields.Char('Formula', required=True, help=('Python expression that will be evaluated with:\n' '- unit_price: the original unit_price'))
[tryton-commits] changeset in modules/sale_product_customer:default Send only the...
changeset f484c5c4c023 in modules/sale_product_customer:default details: https://hg.tryton.org/modules/sale_product_customer?cmd=changeset=f484c5c4c023 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 12 sale.py| 5 ++--- 2 files changed, 6 insertions(+), 11 deletions(-) diffs (65 lines): diff -r afd4ca1bdf1e -r f484c5c4c023 product.py --- a/product.pyWed Apr 06 23:37:44 2022 +0200 +++ b/product.pyFri Apr 08 19:07:14 2022 +0200 @@ -22,8 +22,7 @@ ('products', '=', Eval('product')), ()), If(Eval('active'), ('active', '=', True), ()), -], -depends=['product', 'active']) +]) product = fields.Many2One( 'product.product', "Variant", select=True, domain=[ @@ -31,8 +30,7 @@ ('template', '=', Eval('template')), ()), If(Eval('active'), ('active', '=', True), ()), -], -depends=['template', 'active']) +]) party = fields.Many2One('party.party', "Customer", required=True, ondelete='CASCADE') name = fields.Char("Name", translate=True) @@ -88,8 +86,7 @@ }, domain=[ If(~Eval('active'), ('active', '=', False), ()), -], -depends=['salable', 'active']) +]) def product_customer_used(self, **pattern): for product_customer in self.product_customers: @@ -132,8 +129,7 @@ ], states={ 'invisible': ~Eval('salable', False), -}, -depends=['template', 'salable', 'active']) +}) def product_customer_used(self, **pattern): for product_customer in self.product_customers: diff -r afd4ca1bdf1e -r f484c5c4c023 sale.py --- a/sale.py Wed Apr 06 23:37:44 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -28,7 +28,7 @@ 'invisible': Eval('type') != 'line', 'readonly': Eval('sale_state') != 'draft', }, -depends=['product', 'type', 'sale_state', 'sale']) +depends={'sale'}) @fields.depends('sale', '_parent_sale.party') def _get_product_customer_pattern(self): @@ -80,8 +80,7 @@ ], states={ 'invisible': Eval('action') != 'product', -}, -depends=['action', 'product', 'party']) +}) @fields.depends('line') def on_change_line(self):
[tryton-commits] changeset in modules/sale_price_list:default Send only the requi...
changeset bbc9ce71fbb7 in modules/sale_price_list:default details: https://hg.tryton.org/modules/sale_price_list?cmd=changeset=bbc9ce71fbb7 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: configuration.py | 3 +-- party.py | 5 ++--- sale.py | 7 +-- 3 files changed, 4 insertions(+), 11 deletions(-) diffs (53 lines): diff -r 91f39dd75ca9 -r bbc9ce71fbb7 configuration.py --- a/configuration.py Fri Apr 08 12:31:56 2022 +0200 +++ b/configuration.py Fri Apr 08 19:07:14 2022 +0200 @@ -27,5 +27,4 @@ 'product.price_list', "Sale Price List", domain=[ ('company', '=', Eval('company', -1)), -], -depends=['company']) +]) diff -r 91f39dd75ca9 -r bbc9ce71fbb7 party.py --- a/party.py Fri Apr 08 12:31:56 2022 +0200 +++ b/party.py Fri Apr 08 19:07:14 2022 +0200 @@ -52,13 +52,12 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) sale_price_list = fields.Many2One( 'product.price_list', "Sale Price List", domain=[ ('company', '=', Eval('company', -1)), -], -depends=['company']) +]) @classmethod def __register__(cls, module_name): diff -r 91f39dd75ca9 -r bbc9ce71fbb7 sale.py --- a/sale.py Fri Apr 08 12:31:56 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -13,8 +13,7 @@ states={ 'readonly': Or(Not(Equal(Eval('state'), 'draft')), Bool(Eval('lines', [0]))), -}, -depends=['state', 'company']) +}) @classmethod def __setup__(cls): @@ -23,10 +22,6 @@ | Eval('lines', [0])) cls.lines.states['readonly'] = (cls.lines.states['readonly'] | ~Eval('party') | ~Eval('company')) -if 'party' not in cls.lines.depends: -cls.lines.depends.append('party') -if 'company' not in cls.lines.depends: -cls.lines.depends.append('company') @fields.depends('company') def on_change_party(self):
[tryton-commits] changeset in modules/sale_point:default Send only the required f...
changeset 8253741149c8 in modules/sale_point:default details: https://hg.tryton.org/modules/sale_point?cmd=changeset=8253741149c8 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 1 - sale.py| 89 ++--- 2 files changed, 32 insertions(+), 58 deletions(-) diffs (290 lines): diff -r 362117053013 -r 8253741149c8 product.py --- a/product.pyWed Apr 06 23:37:44 2022 +0200 +++ b/product.pyFri Apr 08 19:07:14 2022 +0200 @@ -15,7 +15,6 @@ states={ 'invisible': ~Eval('salable', False), }, -depends=['salable'], help="The price with default tax included.")) gross_prices = fields.One2Many( 'product.gross_price', 'template', "Gross Prices") diff -r 362117053013 -r 8253741149c8 sale.py --- a/sale.py Wed Apr 06 23:37:44 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -37,8 +37,7 @@ domain=[ ('company', '=', Eval('company', -1)), ('sequence_type', '=', Id('sale_point', 'sequence_type_sale')), -], -depends=['company']) +]) address = fields.Many2One('party.address', "Address") @@ -100,18 +99,15 @@ _states = { 'readonly': Eval('state') != 'open', } -_depends = ['state'] company = fields.Many2One( -'company.company', "Company", required=True, -states=_states, depends=_depends) +'company.company', "Company", required=True, states=_states) employee = fields.Many2One( 'company.employee', "Employee", domain=[ ('company', '=', Eval('company', -1)), ], -states=_states, -depends=['company'] + _depends) +states=_states) point = fields.Many2One( 'sale.point', "Point", required=True, ondelete='RESTRICT', states={ @@ -121,25 +117,21 @@ }, domain=[ ('company', '=', Eval('company', -1)), -], -depends=['company'] + _depends) +]) number = fields.Char( "Number", readonly=True, select=True, states={ 'required': Eval('state').in_(['done', 'posted']), -}, -depends=['state']) -date = fields.Date("Date", required=True, states=_states, depends=_depends) +}) +date = fields.Date("Date", required=True, states=_states) lines = fields.One2Many( 'sale.point.sale.line', 'sale', "Lines", states={ 'readonly': (~Eval('point') | _states['readonly']), -}, -depends=['point'] + _depends) +}) payments = fields.One2Many( -'sale.point.payment', 'sale', "Payments", -states=_states, depends=_depends) +'sale.point.payment', 'sale', "Payments", states=_states) total_tax = fields.Function(Monetary( "Total Tax", currency='currency', digits='currency'), 'on_change_with_total_tax') @@ -168,7 +160,7 @@ currency = fields.Function(fields.Many2One( 'currency.currency', "Currency"), 'on_change_with_currency') -del _states, _depends +del _states @classmethod def __setup__(cls): @@ -446,11 +438,10 @@ _states = { 'readonly': Eval('sale_state') != 'open', } -_depends = ['sale_state'] sale = fields.Many2One( 'sale.point.sale', "Sale", required=True, ondelete='CASCADE', -states=_states, depends=_depends) +states=_states) product = fields.Many2One( 'product.product', "Product", required=True, domain=[ @@ -459,10 +450,9 @@ context={ 'company': Eval('company'), }, -states=_states, depends=_depends + ['company']) +states=_states, depends={'company'}) quantity = fields.Float( -"Quantity", digits='unit', required=True, -states=_states, depends=_depends) +"Quantity", digits='unit', required=True, states=_states) unit = fields.Function( fields.Many2One('product.uom', "Unit"), 'on_change_with_unit') unit_list_price = fields.Numeric( @@ -477,7 +467,7 @@ }) unit_price = fields.Function(fields.Numeric( "Unit Price", digits=price_digits, -depends=['unit_list_price', 'unit_gross_price']), +depends={'unit_list_price', 'unit_gross_price'}), 'on_change_with_unit_price') amount = fields.Function(Monetary( "Amount", currency='currency', digits='currency'), @@ -498,7 +488,7 @@ fields.Many2One('currency.currency', "Currency"), 'on_change_with_currency') -del _states, _depends +del _states @classmethod def __setup__(cls): @@ -721,21 +711,18 @@ readonly=True,
[tryton-commits] changeset in modules/sale_payment:default Send only the required...
changeset a7365169d053 in modules/sale_payment:default details: https://hg.tryton.org/modules/sale_payment?cmd=changeset=a7365169d053 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: sale.py | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diffs (14 lines): diff -r 7a9444b66a34 -r a7365169d053 sale.py --- a/sale.py Wed Apr 06 23:37:44 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -37,9 +37,7 @@ ], states={ 'readonly': Eval('state') != 'quotation', -}, -depends=['company', 'total_amount', 'party', 'invoice_party', -'currency', 'state']) +}) @classmethod @ModelView.button
[tryton-commits] changeset in modules/sale_opportunity:default Send only the requ...
changeset 99aab2e7a1c3 in modules/sale_opportunity:default details: https://hg.tryton.org/modules/sale_opportunity?cmd=changeset=99aab2e7a1c3 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: configuration.py | 3 +-- opportunity.py | 49 +++-- 2 files changed, 20 insertions(+), 32 deletions(-) diffs (150 lines): diff -r e9d3b5b04d3c -r 99aab2e7a1c3 configuration.py --- a/configuration.py Wed Apr 06 23:37:44 2022 +0200 +++ b/configuration.py Fri Apr 08 19:07:14 2022 +0200 @@ -39,8 +39,7 @@ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id('sale_opportunity', 'sequence_type_sale_opportunity')), -], -depends=['company']) +]) @classmethod def __register__(cls, module_name): diff -r e9d3b5b04d3c -r 99aab2e7a1c3 opportunity.py --- a/opportunity.pyWed Apr 06 23:37:44 2022 +0200 +++ b/opportunity.pyFri Apr 08 19:07:14 2022 +0200 @@ -33,12 +33,10 @@ _states_start = { 'readonly': Eval('state') != 'lead', } -_depends_start = ['state'] _states_stop = { 'readonly': Eval('state').in_( ['converted', 'won', 'lost', 'cancelled']), } -_depends_stop = ['state'] number = fields.Char('Number', readonly=True, required=True, select=True) reference = fields.Char('Reference', select=True) @@ -51,7 +49,7 @@ context={ 'company': Eval('company', -1), }, -depends=['state', 'company']) +depends={'company'}) contact = fields.Many2One( 'party.contact_mechanism', "Contact", context={ @@ -63,7 +61,7 @@ depends=['party', 'company']) address = fields.Many2One('party.address', 'Address', domain=[('party', '=', Eval('party'))], -select=True, depends=['party', 'state'], +select=True, states=_states_stop) company = fields.Many2One('company.company', 'Company', required=True, select=True, @@ -73,38 +71,32 @@ domain=[ ('id', If(In('company', Eval('context', {})), '=', '!='), Get(Eval('context', {}), 'company', 0)), -], -depends=_depends_stop) +]) currency = fields.Function(fields.Many2One( 'currency.currency', "Currency"), 'on_change_with_currency') amount = Monetary( "Amount", currency='currency', digits='currency', -states=_states_stop, depends=_depends_stop, +states=_states_stop, help='Estimated revenue amount.') payment_term = fields.Many2One('account.invoice.payment_term', 'Payment Term', states={ 'readonly': In(Eval('state'), ['converted', 'lost', 'cancelled']), -}, -depends=['state']) +}) employee = fields.Many2One('company.employee', 'Employee', states={ 'readonly': _states_stop['readonly'], 'required': ~Eval('state').in_(['lead', 'lost', 'cancelled']), }, -depends=['state', 'company'], domain=[('company', '=', Eval('company'))]) start_date = fields.Date('Start Date', required=True, select=True, -states=_states_start, depends=_depends_start) -end_date = fields.Date('End Date', select=True, -states=_states_stop, depends=_depends_stop) -description = fields.Char('Description', -states=_states_stop, depends=_depends_stop) -comment = fields.Text('Comment', states=_states_stop, -depends=_depends_stop) +states=_states_start) +end_date = fields.Date('End Date', select=True, states=_states_stop) +description = fields.Char('Description', states=_states_stop) +comment = fields.Text('Comment', states=_states_stop) lines = fields.One2Many('sale.opportunity.line', 'opportunity', 'Lines', -states=_states_stop, depends=_depends_stop) +states=_states_stop) conversion_probability = fields.Float('Conversion Probability', digits=(1, 4), required=True, domain=[ @@ -115,10 +107,10 @@ 'readonly': ~Eval('state').in_( ['opportunity', 'lead', 'converted']), }, -depends=['state'], help="Percentage between 0 and 100.") +help="Percentage between 0 and 100.") lost_reason = fields.Text('Reason for loss', states={ 'invisible': Eval('state') != 'lost', -}, depends=['state']) +}) sales = fields.One2Many('sale.sale', 'origin', 'Sales') converted_by = employee_field( @@ -132,8 +124,8 @@ ('cancelled', "Cancelled"), ], "State", required=True, select=True, sort=False, readonly=True) -del _states_start, _depends_start -del _states_stop, _depends_stop +del _states_start
[tryton-commits] changeset in modules/sale_gift_card:default Send only the requir...
changeset 8a8af20ea329 in modules/sale_gift_card:default details: https://hg.tryton.org/modules/sale_gift_card?cmd=changeset=8a8af20ea329 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: account.py | 9 +++-- product.py | 3 +-- sale.py| 24 stock.py | 4 +--- 4 files changed, 13 insertions(+), 27 deletions(-) diffs (141 lines): diff -r 92e0d5732427 -r 8a8af20ea329 account.py --- a/account.pyWed Apr 06 23:37:43 2022 +0200 +++ b/account.pyFri Apr 08 19:07:14 2022 +0200 @@ -42,16 +42,14 @@ ('type.gift_card', '=', True), ('closed', '!=', True), ('company', '=', Eval('company', -1)), -], -depends=['company']) +]) gift_card_account_revenue = fields.Many2One( 'account.account', "Gift Card Revenue", domain=[ ('type.gift_card', '=', True), ('closed', '!=', True), ('company', '=', Eval('company', -1)), -], -depends=['company']) +]) def AccountTypeMixin(template=False): @@ -66,8 +64,7 @@ ], states={ 'invisible': Eval('statement') != 'balance', -}, -depends=['statement']) +}) if not template: for fname in dir(Mixin): field = getattr(Mixin, fname) diff -r 92e0d5732427 -r 8a8af20ea329 product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:14 2022 +0200 @@ -16,8 +16,7 @@ "Gift Card", states={ 'invisible': ~Eval('type').in_(['service', 'goods']), -}, -depends=['type']) +}) @fields.depends('gift_card') def on_change_gift_card(self): diff -r 92e0d5732427 -r 8a8af20ea329 sale.py --- a/sale.py Wed Apr 06 23:37:43 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -47,8 +47,7 @@ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id( 'sale_gift_card', 'sequence_type_gift_card')), -], -depends=['company']) +]) class GiftCard(ModelSQL, ModelView): @@ -59,13 +58,11 @@ _states = { 'readonly': Bool(Eval('origin')) | Bool(Eval('spent_on')), } -_depends = ['origin'] number = fields.Char( -"Number", required=True, states=_states, depends=_depends) +"Number", required=True, states=_states) company = fields.Many2One( -'company.company', "Company", required=True, -states=_states, depends=_depends) +'company.company', "Company", required=True, states=_states) product = fields.Many2One( 'product.product', "Product", required=True, domain=[ @@ -74,13 +71,12 @@ context={ 'company': Eval('company', -1), }, -states=_states, depends=_depends + ['company']) +states=_states, depends={'company'}) value = Monetary( "Value", currency='currency', digits='currency', required=True, -states=_states, depends=_depends) +states=_states) currency = fields.Many2One( -'currency.currency', "Currency", required=True, -states=_states, depends=_depends) +'currency.currency', "Currency", required=True, states=_states) origin = fields.Reference( "Origin", selection='get_origin', select=True, readonly=True) @@ -88,7 +84,6 @@ "Spent On", selection='get_spent_on', select=True, readonly=True) del _states -del _depends @classmethod def __setup__(cls): @@ -269,8 +264,7 @@ ], states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state', 'company', 'currency']) +}) @classmethod @ModelView.button @@ -339,8 +333,7 @@ ], states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state', 'company', 'currency']) +}) @fields.depends('state', 'gift_cards') def on_change_with_total(self, name=None): @@ -410,7 +403,6 @@ states={ 'invisible': ~Eval('is_gift_card_service', False), }, -depends=['is_gift_card_service'], help="Leave empty for the customer email.") @fields.depends('product') diff -r 92e0d5732427 -r 8a8af20ea329 stock.py --- a/stock.py Wed Apr 06 23:37:43 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:14 2022 +0200 @@ -29,9 +29,7 @@ & (Eval('state') == 'done')), 'readonly': Eval('state').in_(['cancel', 'done']), }, -depends=[ -'gift_cards_required', 'internal_quantity', 'company', 'product', -'state']) +depends={'internal_quantity'})
[tryton-commits] changeset in modules/sale_extra:default Send only the required f...
changeset 5c6647fd6bd6 in modules/sale_extra:default details: https://hg.tryton.org/modules/sale_extra?cmd=changeset=5c6647fd6bd6 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: sale.py | 12 1 files changed, 4 insertions(+), 8 deletions(-) diffs (39 lines): diff -r 951ff9252f4c -r 5c6647fd6bd6 sale.py --- a/sale.py Wed Apr 06 23:37:43 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -77,22 +77,19 @@ datetime.date.max, Eval('end_date', datetime.date.max))), ('start_date', '=', None), -], -depends=['end_date']) +]) end_date = fields.Date('End Date', domain=['OR', ('end_date', '>=', If(~Eval('start_date', None), datetime.date.min, Eval('start_date', datetime.date.min))), ('end_date', '=', None), -], -depends=['start_date']) +]) price_list = fields.Many2One('product.price_list', 'Price List', ondelete='CASCADE', domain=[ ('company', '=', Eval('company', -1)), -], -depends=['company']) +]) sale_amount = Monetary( "Sale Amount", currency='currency', digits='currency') currency = fields.Function(fields.Many2One( @@ -209,8 +206,7 @@ unit = fields.Many2One('product.uom', 'Unit', required=True, domain=[ ('category', '=', Eval('product_uom_category', -1)), -], -depends=['product_uom_category']) +]) free = fields.Boolean('Free') currency = fields.Function(fields.Many2One( 'currency.currency', "Currency"),
[tryton-commits] changeset in modules/sale_discount:default Send only the require...
changeset 10791a811f3d in modules/sale_discount:default details: https://hg.tryton.org/modules/sale_discount?cmd=changeset=10791a811f3d description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: sale.py | 9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diffs (31 lines): diff -r 2cb83036371a -r 10791a811f3d sale.py --- a/sale.py Wed Apr 06 23:37:43 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -17,24 +17,21 @@ states={ 'invisible': Eval('type') != 'line', 'readonly': Eval('sale_state') != 'draft', -}, -depends=['type', 'sale_state']) +}) discount_rate = fields.Function(fields.Numeric( "Discount Rate", digits=(16, 4), states={ 'invisible': Eval('type') != 'line', 'readonly': Eval('sale_state') != 'draft', -}, -depends=['type', 'sale_state']), +}), 'on_change_with_discount_rate', setter='set_discount_rate') discount_amount = fields.Function(Monetary( "Discount Amount", currency='currency', digits=price_digits, states={ 'invisible': Eval('type') != 'line', 'readonly': Eval('sale_state') != 'draft', -}, -depends=['type', 'sale_state']), +}), 'on_change_with_discount_amount', setter='set_discount_amount') discount = fields.Function(fields.Char(
[tryton-commits] changeset in modules/sale_complaint:default Send only the requir...
changeset af86855d9ca3 in modules/sale_complaint:default details: https://hg.tryton.org/modules/sale_complaint?cmd=changeset=af86855d9ca3 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: complaint.py | 43 +-- sale.py | 3 +-- 2 files changed, 18 insertions(+), 28 deletions(-) diffs (162 lines): diff -r 925eef105f9a -r af86855d9ca3 complaint.py --- a/complaint.py Wed Apr 06 23:37:43 2022 +0200 +++ b/complaint.py Fri Apr 08 19:07:14 2022 +0200 @@ -33,26 +33,24 @@ _states = { 'readonly': Eval('state') != 'draft', } -_depends = ['state'] number = fields.Char('Number', readonly=True, select=True) reference = fields.Char('Reference', select=True) -date = fields.Date('Date', states=_states, depends=_depends) +date = fields.Date('Date', states=_states) customer = fields.Many2One( 'party.party', "Customer", required=True, states=_states, context={ 'company': Eval('company', -1), }, -depends=_depends + ['company']) +depends={'company'}) address = fields.Many2One('party.address', 'Address', domain=[('party', '=', Eval('customer'))], -states=_states, depends=_depends + ['customer']) +states=_states) company = fields.Many2One('company.company', 'Company', required=True, -states=_states, depends=_depends) -employee = fields.Many2One('company.employee', 'Employee', -states=_states, depends=_depends) +states=_states) +employee = fields.Many2One('company.employee', 'Employee', states=_states) type = fields.Many2One('sale.complaint.type', 'Type', required=True, -states=_states, depends=_depends) +states=_states) origin = fields.Reference('Origin', selection='get_origin', domain={ 'sale.sale': [ @@ -93,18 +91,18 @@ | Bool(Eval('actions', [0]))), 'required': Bool(Eval('origin_model')), }, -depends=['state', 'customer', 'origin_model', 'company']) +depends={'origin_model'}) origin_id = fields.Function(fields.Integer('Origin ID'), 'on_change_with_origin_id') origin_model = fields.Function(fields.Char('Origin Model'), 'on_change_with_origin_model') -description = fields.Text('Description', states=_states, depends=_depends) +description = fields.Text('Description', states=_states) actions = fields.One2Many('sale.complaint.action', 'complaint', 'Actions', states={ 'readonly': ((Eval('state') != 'draft') | (If(~Eval('origin_id', 0), 0, Eval('origin_id', 0)) <= 0)), }, -depends=['state', 'origin_model', 'origin_id']) +depends={'origin_model'}) state = fields.Selection([ ('draft', 'Draft'), ('waiting', 'Waiting'), @@ -345,18 +343,16 @@ 'readonly': ((Eval('complaint_state') != 'draft') | Bool(Eval('result'))), } -_depends = ['complaint_state', 'result'] _line_states = { 'invisible': ~Eval('_parent_complaint', {} ).get('origin_model', 'sale.line').in_( ['sale.line', 'account.invoice.line']), 'readonly': _states['readonly'], } -_line_depends = _depends complaint = fields.Many2One( 'sale.complaint', 'Complaint', required=True, ondelete='CASCADE', -states=_states, depends=_depends) +states=_states) action = fields.Selection([ ('sale_return', 'Create Sale Return'), ('credit_note', 'Create Credit Note'), @@ -369,7 +365,6 @@ ).get('origin_model', 'sale.sale') != 'sale.sale', 'readonly': _states['readonly'], }, -depends=_depends, help='Leave empty for all lines.') invoice_lines = fields.One2Many( @@ -381,19 +376,18 @@ ) != 'account.invoice', 'readonly': _states['readonly'], }, -depends=_depends, help='Leave empty for all lines.') quantity = fields.Float( "Quantity", digits='unit', -states=_line_states, depends=_line_depends, +states=_line_states, help='Leave empty for the same quantity.') unit = fields.Function(fields.Many2One('product.uom', 'Unit', -states=_line_states, depends=_line_depends), +states=_line_states), 'on_change_with_unit') unit_price = Monetary( "Unit Price", currency='currency', digits=price_digits, -states=_line_states, depends=_line_depends, +states=_line_states, help='Leave empty for the same price.') amount = fields.Function(Monetary( @@ -616,17 +610,16 @@ (Eval('complaint_state') != 'draft') |
[tryton-commits] changeset in modules/sale_amendment:default Send only the requir...
changeset 045cd06f5a84 in modules/sale_amendment:default details: https://hg.tryton.org/modules/sale_amendment?cmd=changeset=045cd06f5a84 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: sale.py | 54 ++ 1 files changed, 18 insertions(+), 36 deletions(-) diffs (169 lines): diff -r 660672cde6c8 -r 045cd06f5a84 sale.py --- a/sale.py Wed Apr 06 23:37:43 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:14 2022 +0200 @@ -20,8 +20,7 @@ 'invisible': ((Eval('state') != 'processing') | ~Eval('amendments')), 'readonly': Eval('state') != 'processing', -}, -depends=['state']) +}) @classmethod def copy(cls, sales, default=None): @@ -44,20 +43,17 @@ ], states={ 'readonly': (Eval('state') != 'draft') | Eval('lines', [0]), -}, -depends=['state']) +}) date = fields.Date( "Date", required=True, states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) description = fields.Char( "Description", states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) state = fields.Selection([ ('draft', "Draft"), ('validated', "Validated"), @@ -66,8 +62,7 @@ 'sale.amendment.line', 'amendment', "Lines", states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) @classmethod def __setup__(cls): @@ -194,8 +189,7 @@ ], "Action", required=True, states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) sale = fields.Function(fields.Many2One( 'sale.sale', "Sale"), 'on_change_with_sale') @@ -209,15 +203,13 @@ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'line', 'required': Eval('action') == 'line', -}, -depends=['state', 'sale', 'action']) +}) payment_term = fields.Many2One( 'account.invoice.payment_term', "Payment Term", states={ 'invisible': Eval('action') != 'payment_term', -}, -depends=['action']) +}) party = fields.Many2One( 'party.party', "Party", @@ -225,8 +217,7 @@ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'party', 'required': Eval('action') == 'party', -}, -depends=['state', 'action']) +}) invoice_address = fields.Many2One( 'party.address', "Invoice Address", domain=[ @@ -236,15 +227,13 @@ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'party', 'required': Eval('action') == 'party', -}, -depends=['state', 'action', 'party']) +}) shipment_party = fields.Many2One( 'party.party', "Shipment Party", states={ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'party', -}, -depends=['state', 'action']) +}) shipment_address = fields.Many2One( 'party.address', "Shipment Address", domain=[ @@ -255,8 +244,7 @@ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'party', 'required': Eval('action') == 'party', -}, -depends=['state', 'action', 'party', 'shipment_party']) +}) warehouse = fields.Many2One( 'stock.location', "Warehouse", @@ -267,8 +255,7 @@ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'warehouse', 'required': Eval('action') == 'warehouse', -}, -depends=['state', 'action']) +}) product = fields.Many2One( 'product.product', "Product", @@ -283,16 +270,14 @@ states={ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'line', -}, -depends=['action', 'state', 'product_uom_category']) +}) quantity = fields.Float( "Quantity", digits='unit', states={ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'line', 'required': Eval('action') == 'line', -}, -depends=['action']) +}) unit = fields.Many2One( 'product.uom', "Unit", ondelete='RESTRICT', domain=[ @@ -304,23 +289,20 @@ 'readonly': Eval('state') != 'draft',
[tryton-commits] changeset in modules/sale_advance_payment:default Send only the ...
changeset a1322a32eb34 in modules/sale_advance_payment:default details: https://hg.tryton.org/modules/sale_advance_payment?cmd=changeset=a1322a32eb34 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: account.py | 3 +-- sale.py| 32 ++-- 2 files changed, 11 insertions(+), 24 deletions(-) diffs (94 lines): diff -r bcee92840340 -r a1322a32eb34 account.py --- a/account.pyWed Apr 06 23:37:43 2022 +0200 +++ b/account.pyFri Apr 08 19:07:13 2022 +0200 @@ -19,8 +19,7 @@ states={ 'invisible': ((Eval('statement') != 'balance') | Eval('assets', True)), -}, -depends=['statement', 'assets']) +}) if not template: for fname in dir(Mixin): field = getattr(Mixin, fname) diff -r bcee92840340 -r a1322a32eb34 sale.py --- a/sale.py Wed Apr 06 23:37:43 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:13 2022 +0200 @@ -136,8 +136,7 @@ domain=[ ('type.unearned_revenue', '=', True), ('company', '=', Eval('company', -1)), -], -depends=['company']) +]) class AdvancePaymentCondition(ModelSQL, ModelView): @@ -148,34 +147,26 @@ _states = { 'readonly': Eval('sale_state') != 'draft', } -_depends = ['sale_state'] sale = fields.Many2One('sale.sale', 'Sale', required=True, ondelete='CASCADE', select=True, states={ 'readonly': ((Eval('sale_state') != 'draft') & Bool(Eval('sale'))), -}, -depends=['sale_state']) -description = fields.Char( -"Description", required=True, states=_states, depends=_depends) +}) +description = fields.Char("Description", required=True, states=_states) amount = Monetary( -"Amount", currency='currency', digits='currency', -states=_states, depends=_depends) +"Amount", currency='currency', digits='currency', states=_states) account = fields.Many2One( 'account.account', "Account", required=True, domain=[ ('type.unearned_revenue', '=', True), ('company', '=', Eval('sale_company')), ], -states=_states, -depends=_depends + ['sale_company']) -block_supply = fields.Boolean( -"Block Supply", states=_states, depends=_depends) -block_shipping = fields.Boolean( -"Block Shipping", states=_states, depends=_depends) -invoice_delay = fields.TimeDelta( -"Invoice Delay", states=_states, depends=_depends) +states=_states) +block_supply = fields.Boolean("Block Supply", states=_states) +block_shipping = fields.Boolean("Block Shipping", states=_states) +invoice_delay = fields.TimeDelta("Invoice Delay", states=_states) invoice_lines = fields.One2Many( 'account.invoice.line', 'origin', "Invoice Lines", readonly=True) @@ -190,7 +181,6 @@ 'on_change_with_currency') del _states -del _depends @classmethod def __setup__(cls): @@ -292,15 +282,13 @@ 'Advance Payment Term', ondelete='RESTRICT', states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) advance_payment_conditions = fields.One2Many( 'sale.advance_payment.condition', 'sale', 'Advance Payment Conditions', states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) advance_payment_invoices = fields.Function(fields.Many2Many( 'account.invoice', None, None, "Advance Payment Invoices"), 'get_advance_payment_invoices',
[tryton-commits] changeset in modules/sale:default Send only the required fields ...
changeset 3aa0d3c52d33 in modules/sale:default details: https://hg.tryton.org/modules/sale?cmd=changeset=3aa0d3c52d33 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: configuration.py | 3 +- party.py | 2 +- product.py| 6 +--- sale.py | 72 -- sale_reporting.py | 12 +++- 5 files changed, 36 insertions(+), 59 deletions(-) diffs (355 lines): diff -r 5076ae40e1f5 -r 3aa0d3c52d33 configuration.py --- a/configuration.py Wed Apr 06 23:37:43 2022 +0200 +++ b/configuration.py Fri Apr 08 19:07:13 2022 +0200 @@ -75,8 +75,7 @@ domain=[ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id('sale', 'sequence_type_sale')), -], -depends=['company']) +]) @classmethod def __register__(cls, module_name): diff -r 5076ae40e1f5 -r 3aa0d3c52d33 party.py --- a/party.py Wed Apr 06 23:37:43 2022 +0200 +++ b/party.py Fri Apr 08 19:07:13 2022 +0200 @@ -66,7 +66,7 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) sale_invoice_method = fields.Selection( 'get_sale_invoice_method', "Sale Invoice Method") sale_shipment_method = fields.Selection( diff -r 5076ae40e1f5 -r 3aa0d3c52d33 product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -43,14 +43,12 @@ }, domain=[ ('category', '=', Eval('default_uom_category')), -], -depends=['salable', 'default_uom_category']) +]) lead_time = fields.TimeDelta( "Lead Time", states={ 'invisible': ~Eval('salable', False), }, -depends=['salable'], help="The time from confirming the sales order to sending the " "products.\n" "If empty the default lead time from the configuration is used.") @@ -203,7 +201,7 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) sale_date = fields.Date("Sale Date") quantity = fields.Float("Quantity") diff -r 5076ae40e1f5 -r 3aa0d3c52d33 sale.py --- a/sale.py Wed Apr 06 23:37:43 2022 +0200 +++ b/sale.py Fri Apr 08 19:07:13 2022 +0200 @@ -75,28 +75,24 @@ | Eval('party', True) | Eval('invoice_party', True) | Eval('shipment_party', True)), -}, -depends=['state']) +}) number = fields.Char('Number', readonly=True, select=True) reference = fields.Char('Reference', select=True) description = fields.Char('Description', states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) sale_date = fields.Date('Sale Date', states={ 'readonly': ~Eval('state').in_(['draft', 'quotation']), 'required': ~Eval('state').in_( ['draft', 'quotation', 'cancelled']), -}, -depends=['state']) +}) payment_term = fields.Many2One('account.invoice.payment_term', 'Payment Term', states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) party = fields.Many2One('party.party', 'Party', required=True, select=True, states={ 'readonly': ((Eval('state') != 'draft') @@ -105,7 +101,7 @@ context={ 'company': Eval('company', -1), }, -depends=['state', 'company']) +depends={'company'}) party_lang = fields.Function(fields.Char('Party Language'), 'on_change_with_party_lang') contact = fields.Many2One( @@ -116,7 +112,7 @@ search_context={ 'related_party': Eval('party'), }, -depends=['party', 'company']) +depends={'company'}) invoice_party = fields.Many2One('party.party', "Invoice Party", states={ 'readonly': ((Eval('state') != 'draft') @@ -128,7 +124,7 @@ search_context={ 'related_party': Eval('party'), }, -depends=['state', 'party', 'company']) +depends={'company'}) invoice_address = fields.Many2One('party.address', 'Invoice Address', domain=[ ('party', '=', If(Bool(Eval('invoice_party')), @@ -138,7 +134,7 @@ 'readonly': Eval('state') != 'draft', 'required': ~Eval('state').in_( ['draft', 'quotation', 'cancelled']), -}, depends=['party', 'invoice_party', 'state']) +}) shipment_party = fields.Many2One('party.party', 'Shipment Party', states={
[tryton-commits] changeset in modules/purchase_shipment_cost:default Send only th...
changeset bb041b39f113 in modules/purchase_shipment_cost:default details: https://hg.tryton.org/modules/purchase_shipment_cost?cmd=changeset=bb041b39f113 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: stock.py | 16 +--- 1 files changed, 5 insertions(+), 11 deletions(-) diffs (54 lines): diff -r 6991877602a1 -r bb041b39f113 stock.py --- a/stock.py Wed Apr 06 23:37:43 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:13 2022 +0200 @@ -14,15 +14,13 @@ __name__ = 'stock.shipment.in' carrier = fields.Many2One('carrier', 'Carrier', states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) cost_currency_used = fields.Function(fields.Many2One( 'currency.currency', "Cost Currency", states={ 'invisible': Eval('cost_edit', False), -}, -depends=['cost_edit']), +}), 'on_change_with_cost_currency_used') cost_currency = fields.Many2One( 'currency.currency', "Cost Currency", @@ -30,29 +28,25 @@ 'required': Bool(Eval('cost')), 'invisible': ~Eval('cost_edit', False), 'readonly': ~Eval('state').in_(['draft']), -}, -depends=['cost', 'cost_edit', 'state']) +}) cost_used = fields.Function(fields.Numeric( "Cost", digits=price_digits, states={ 'invisible': Eval('cost_edit', False), -}, -depends=['cost_edit']), +}), 'on_change_with_cost_used') cost = fields.Numeric( "Cost", digits=price_digits, states={ 'invisible': ~Eval('cost_edit', False), 'readonly': ~Eval('state').in_(['draft']), -}, -depends=['cost_edit', 'state']) +}) cost_edit = fields.Boolean( "Edit Cost", states={ 'readonly': ~Eval('state').in_(['draft']), }, -depends=['state'], help="Check to edit the cost.") def _get_carrier_context(self):
[tryton-commits] changeset in modules/purchase_secondary_unit:default Send only t...
changeset e6a037bd14d4 in modules/purchase_secondary_unit:default details: https://hg.tryton.org/modules/purchase_secondary_unit?cmd=changeset=e6a037bd14d4 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 6 +- purchase.py | 10 +++--- 2 files changed, 4 insertions(+), 12 deletions(-) diffs (69 lines): diff -r ac215808e81e -r e6a037bd14d4 product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -15,15 +15,13 @@ 'product.uom', "Purchase Secondary UOM", domain=[ ('category', '!=', Eval('default_uom_category')), -], -depends=['default_uom_category']) +]) purchase_secondary_uom_factor = fields.Float( "Purchase Secondary UOM Factor", digits=uom_conversion_digits, states={ 'required': Bool(Eval('purchase_secondary_uom')), 'invisible': ~Eval('purchase_secondary_uom'), }, -depends=['purchase_secondary_uom'], help="The coefficient for the formula:\n" "1 (purchase unit) = coefficient (secondary unit)") purchase_secondary_uom_rate = fields.Float( @@ -32,7 +30,6 @@ 'required': Bool(Eval('purchase_secondary_uom')), 'invisible': ~Eval('purchase_secondary_uom'), }, -depends=['purchase_secondary_uom'], help="The coefficient for the formula:\n" "coefficient (purchase unit) = 1 (secondary unit)") purchase_secondary_uom_category = fields.Function( @@ -126,7 +123,6 @@ cls.purchase_secondary_uom.states = { 'invisible': ~Eval('purchasable', False), } -cls.purchase_secondary_uom.depends.append('purchasable') class Product(metaclass=PoolMeta): diff -r ac215808e81e -r e6a037bd14d4 purchase.py --- a/purchase.py Wed Apr 06 23:37:43 2022 +0200 +++ b/purchase.py Fri Apr 08 19:07:13 2022 +0200 @@ -16,8 +16,7 @@ 'invisible': ((Eval('type') != 'line') | ~Eval('secondary_unit')), 'readonly': Eval('purchase_state') != 'draft', -}, -depends=['type', 'secondary_unit', 'purchase_state']), +}), 'on_change_with_secondary_quantity', setter='set_secondary') secondary_unit = fields.Many2One( 'product.uom', "Secondary Unit", ondelete='RESTRICT', @@ -31,17 +30,14 @@ | (~Eval('secondary_uom_factor') & ~Eval('secondary_uom_rate'))), 'readonly': Eval('purchase_state') != 'draft', -}, -depends=['product_secondary_uom_category', 'type', -'secondary_uom_factor', 'secondary_uom_rate', 'purchase_state']) +}) secondary_unit_price = fields.Function(Monetary( "Secondary Unit Price", currency='currency', digits=price_digits, states={ 'invisible': ((Eval('type') != 'line') | ~Eval('secondary_unit')), 'readonly': Eval('purchase_state') != 'draft', -}, -depends=['type', 'secondary_unit', 'purchase_state']), +}), 'on_change_with_secondary_unit_price', setter='set_secondary') secondary_uom_factor = fields.Float("Secondary UOM Factor")
[tryton-commits] changeset in modules/purchase_requisition:default Send only the ...
changeset 67917ffe1439 in modules/purchase_requisition:default details: https://hg.tryton.org/modules/purchase_requisition?cmd=changeset=67917ffe1439 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: purchase.py | 41 ++--- 1 files changed, 14 insertions(+), 27 deletions(-) diffs (122 lines): diff -r add0efde098f -r 67917ffe1439 purchase.py --- a/purchase.py Wed Apr 06 23:37:43 2022 +0200 +++ b/purchase.py Fri Apr 08 19:07:13 2022 +0200 @@ -53,8 +53,7 @@ ('sequence_type', '=', Id('purchase_requisition', 'sequence_type_purchase_requisition')), -], -depends=['company']) +]) @classmethod def __register__(cls, module_name): @@ -93,40 +92,34 @@ _states = { 'readonly': Eval('state') != 'draft', } -_depends = ['state'] company = fields.Many2One( 'company.company', "Company", required=True, select=True, states={ 'readonly': (Eval('state') != 'draft') | Eval('lines', [0]), -}, -depends=['lines'] + _depends) +}) number = fields.Char('Number', readonly=True, select=True) -description = fields.Char( -'Description', states=_states, depends=_depends) +description = fields.Char('Description', states=_states) employee = fields.Many2One( -'company.employee', 'Employee', required=True, -states=_states, depends=_depends) +'company.employee', 'Employee', required=True, states=_states) supply_date = fields.Date( 'Supply Date', states={ 'required': ~Eval('state').in_(['draft', 'cancelled']), 'readonly': _states['readonly'], -}, -depends=_depends) +}) warehouse = fields.Many2One( 'stock.location', 'Warehouse', domain=[ ('type', '=', 'warehouse'), ], -states=_states, depends=_depends) +states=_states) currency = fields.Many2One( 'currency.currency', 'Currency', states={ 'readonly': (_states['readonly'] | (Eval('lines', [0]) & Eval('currency'))), -}, -depends=_depends) +}) total_amount = fields.Function( Monetary("Total", currency='currency', digits='currency'), 'get_amount') @@ -134,7 +127,7 @@ "Total Cache", currency='currency', digits='currency') lines = fields.One2Many( 'purchase.requisition.line', 'requisition', 'Lines', -states=_states, depends=_depends) +states=_states) approved_by = employee_field( "Approved By", states=['approved', 'processing', 'done', 'cancelled']) @@ -428,38 +421,33 @@ _states = { 'readonly': Eval('purchase_requisition_state') != 'draft', } -_depends = ['purchase_requisition_state'] requisition = fields.Many2One( 'purchase.requisition', 'Requisition', ondelete='CASCADE', select=True, required=True) -supplier = fields.Many2One( -'party.party', 'Supplier', states=_states, depends=_depends) +supplier = fields.Many2One('party.party', 'Supplier', states=_states) product = fields.Many2One( 'product.product', 'Product', ondelete='RESTRICT', domain=[ ('purchasable', '=', True), ], -states=_states, depends=_depends) +states=_states) product_uom_category = fields.Function( fields.Many2One('product.uom.category', "Product UOM Category"), 'on_change_with_product_uom_category') -description = fields.Text("Description", states=_states, depends=_depends) +description = fields.Text("Description", states=_states) summary = fields.Function(fields.Char('Summary'), 'on_change_with_summary') quantity = fields.Float( -"Quantity", digits='unit', required=True, -states=_states, depends=_depends) +"Quantity", digits='unit', required=True, states=_states) unit = fields.Many2One( 'product.uom', 'Unit', ondelete='RESTRICT', states={ 'required': Bool(Eval('product')), 'readonly': _states['readonly'], -}, -depends=['product'] + _depends) +}) unit_price = Monetary( -'Unit Price', currency='currency', digits=price_digits, -states=_states, depends=_depends) +'Unit Price', currency='currency', digits=price_digits, states=_states) currency = fields.Function(fields.Many2One('currency.currency', 'Currency'), 'on_change_with_currency') amount = fields.Function(Monetary( @@ -483,7 +471,6 @@ ('category', 'in', [Eval(c) for c in unit_categories]), ('category', '!=', -1)), ] -
[tryton-commits] changeset in modules/purchase_request_quotation:default Send onl...
changeset 9ba8d0f8b582 in modules/purchase_request_quotation:default details: https://hg.tryton.org/modules/purchase_request_quotation?cmd=changeset=9ba8d0f8b582 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: purchase.py | 26 -- 1 files changed, 8 insertions(+), 18 deletions(-) diffs (96 lines): diff -r 537f2dec0b34 -r 9ba8d0f8b582 purchase.py --- a/purchase.py Wed Apr 06 23:37:43 2022 +0200 +++ b/purchase.py Fri Apr 08 19:07:13 2022 +0200 @@ -68,8 +68,7 @@ ('sequence_type', '=', Id('purchase_request_quotation', 'sequence_type_purchase_request_quotation')), -], -depends=['company']) +]) @classmethod def default_purchase_request_quotation_sequence(cls): @@ -92,7 +91,6 @@ states={ 'required': ~Eval('state').in_(['draft', 'cancelled']) }, -depends=['state'], help="The unique identifier of the quotation.") revision = fields.Integer('Revision', readonly=True, help="Number incremented each time the quotation is sent.") @@ -114,17 +112,15 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) supplier_address = fields.Many2One('party.address', 'Supplier Address', domain=[ ('party', '=', Eval('supplier')), -], -depends=['supplier']) +]) lines = fields.One2Many('purchase.request.quotation.line', 'quotation', 'Lines', states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) state = fields.Selection([ ('draft', 'Draft'), ('sent', 'Sent'), @@ -270,8 +266,7 @@ description = fields.Text('Description', states={ 'required': ~Eval('product') -}, -depends=['product']) +}) quantity = fields.Float("Quantity", digits='unit', required=True) unit = fields.Many2One( 'product.uom', 'Unit', ondelete='RESTRICT', @@ -282,8 +277,7 @@ If(Bool(Eval('product_uom_category')), ('category', '=', Eval('product_uom_category')), ('category', '!=', -1)), -], -depends=['product', 'product_uom_category']) +]) product_uom_category = fields.Function( fields.Many2One('product.uom.category', 'Product Uom Category'), 'on_change_with_product_uom_category') @@ -292,8 +286,7 @@ currency = fields.Many2One('currency.currency', 'Currency', states={ 'required': Bool(Eval('unit_price')), -}, -depends=['unit_price']) +}) request = fields.Many2One('purchase.request', 'Request', ondelete='CASCADE', select=True, required=True, domain=[ @@ -303,14 +296,12 @@ states={ 'readonly': Eval('quotation_state') != 'draft' }, -depends=['quotation_state'], help="The request which this line belongs to.") quotation = fields.Many2One('purchase.request.quotation', 'Quotation', ondelete='CASCADE', required=True, domain=[ ('supplier', '=', Eval('supplier')), -], -depends=['supplier']) +]) quotation_state = fields.Function(fields.Selection( 'get_quotation_state', 'Quotation State'), 'on_change_with_quotation_state', searcher='search_quotation_state') @@ -563,7 +554,6 @@ ('quotation_state', '=', 'received'), ('request', '=', Eval('id')) ], -depends=['id'], help="The quotation that will be chosen to create the purchase\n" "otherwise first ordered received quotation line will be selected.")
[tryton-commits] changeset in modules/purchase_request:default Send only the requ...
changeset 54b608e280c6 in modules/purchase_request:default details: https://hg.tryton.org/modules/purchase_request?cmd=changeset=54b608e280c6 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: purchase_request.py | 18 +++--- 1 files changed, 7 insertions(+), 11 deletions(-) diffs (61 lines): diff -r 8c9d50aff33b -r 54b608e280c6 purchase_request.py --- a/purchase_request.py Wed Apr 06 23:37:43 2022 +0200 +++ b/purchase_request.py Fri Apr 08 19:07:13 2022 +0200 @@ -20,7 +20,6 @@ STATES = { 'readonly': Eval('state') != 'draft', } -DEPENDS = ['state'] class PurchaseRequest(ModelSQL, ModelView): @@ -33,18 +32,17 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) -description = fields.Text('Description', readonly=True, -states=STATES, depends=DEPENDS) +depends={'company'}) +description = fields.Text('Description', readonly=True, states=STATES) summary = fields.Function(fields.Char('Summary'), 'on_change_with_summary') party = fields.Many2One( 'party.party', "Party", select=True, states=STATES, context={ 'company': Eval('company', -1), }, -depends=DEPENDS + ['company']) +depends={'company'}) quantity = fields.Float('Quantity', required=True, states=STATES, -digits=(16, Eval('uom_digits', 2)), depends=DEPENDS + ['uom_digits']) +digits=(16, Eval('uom_digits', 2))) uom = fields.Many2One('product.uom', 'UOM', select=True, ondelete='RESTRICT', domain=[ @@ -55,8 +53,7 @@ states={ 'required': Bool(Eval('product')), 'readonly': STATES['readonly'], -}, -depends=['product', 'product_uom_category'] + DEPENDS) +}) uom_digits = fields.Function(fields.Integer('UOM Digits'), 'on_change_with_uom_digits') product_uom_category = fields.Function( @@ -72,14 +69,13 @@ default_uom_digits = fields.Function(fields.Integer('Default UOM Digits'), 'on_change_with_default_uom_digits') stock_level = fields.Float('Stock at Supply Date', readonly=True, -digits=(16, Eval('default_uom_digits', 2)), -depends=['default_uom_digits']) +digits=(16, Eval('default_uom_digits', 2))) warehouse = fields.Many2One( 'stock.location', "Warehouse", states={ 'required': Eval('warehouse_required', False), }, -domain=[('type', '=', 'warehouse')], depends=['warehouse_required'], +domain=[('type', '=', 'warehouse')], readonly=True) warehouse_required = fields.Function(fields.Boolean('Warehouse Required'), 'get_warehouse_required')
[tryton-commits] changeset in modules/purchase_price_list:default Send only the r...
changeset 5b1fa3a8a075 in modules/purchase_price_list:default details: https://hg.tryton.org/modules/purchase_price_list?cmd=changeset=5b1fa3a8a075 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: party.py| 5 ++--- purchase.py | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diffs (28 lines): diff -r 06c5bf678cdd -r 5b1fa3a8a075 party.py --- a/party.py Wed Apr 06 23:37:43 2022 +0200 +++ b/party.py Fri Apr 08 19:07:13 2022 +0200 @@ -30,10 +30,9 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) purchase_price_list = fields.Many2One( 'product.price_list', "Purchase Price List", domain=[ ('company', '=', Eval('company', -1)), -], -depends=['company']) +]) diff -r 06c5bf678cdd -r 5b1fa3a8a075 purchase.py --- a/purchase.py Wed Apr 06 23:37:43 2022 +0200 +++ b/purchase.py Fri Apr 08 19:07:13 2022 +0200 @@ -14,8 +14,6 @@ | Eval('lines', [0])) cls.lines.states['readonly'] = (cls.lines.states['readonly'] | ~Eval('party')) -if 'party' not in cls.lines.depends: -cls.lines.depends.append('party') class Line(metaclass=PoolMeta):
[tryton-commits] changeset in modules/purchase_amendment:default Send only the re...
changeset dffe940a2f74 in modules/purchase_amendment:default details: https://hg.tryton.org/modules/purchase_amendment?cmd=changeset=dffe940a2f74 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: purchase.py | 51 +-- 1 files changed, 17 insertions(+), 34 deletions(-) diffs (161 lines): diff -r 9d6b97f71d02 -r dffe940a2f74 purchase.py --- a/purchase.py Wed Apr 06 23:37:43 2022 +0200 +++ b/purchase.py Fri Apr 08 19:07:13 2022 +0200 @@ -20,8 +20,7 @@ 'invisible': ((Eval('state') != 'processing') | ~Eval('amendments')), 'readonly': Eval('state') != 'processing', -}, -depends=['state']) +}) @classmethod def copy(cls, purchases, default=None): @@ -44,20 +43,17 @@ ], states={ 'readonly': (Eval('state') != 'draft') | Eval('lines', [0]), -}, -depends=['state']) +}) date = fields.Date( "Date", required=True, states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) description = fields.Char( "Description", states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) state = fields.Selection([ ('draft', "Draft"), ('validated', "Validated"), @@ -66,8 +62,7 @@ 'purchase.amendment.line', 'amendment', "Lines", states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) @classmethod def __setup__(cls): @@ -178,8 +173,7 @@ ], "Action", required=True, states={ 'readonly': Eval('state') != 'draft', -}, -depends=['state']) +}) purchase = fields.Function(fields.Many2One( 'purchase.purchase', "Purchase"), 'on_change_with_purchase') @@ -193,15 +187,13 @@ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'line', 'required': Eval('action') == 'line', -}, -depends=['state', 'purchase', 'action']) +}) payment_term = fields.Many2One( 'account.invoice.payment_term', "Payment Term", states={ 'invisible': Eval('action') != 'payment_term', -}, -depends=['action']) +}) party = fields.Many2One( 'party.party', "Party", @@ -209,8 +201,7 @@ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'party', 'required': Eval('action') == 'party', -}, -depends=['state', 'action']) +}) invoice_address = fields.Many2One( 'party.address', "Invoice Address", domain=[ @@ -220,8 +211,7 @@ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'party', 'required': Eval('action') == 'party', -}, -depends=['state', 'action', 'party']) +}) warehouse = fields.Many2One( 'stock.location', "Warehouse", @@ -232,8 +222,7 @@ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'warehouse', 'required': Eval('action') == 'warehouse', -}, -depends=['state', 'action']) +}) product = fields.Many2One( 'product.product', "Product", @@ -248,8 +237,7 @@ states={ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'line', -}, -depends=['action', 'state', 'product_uom_category']) +}) product_supplier = fields.Many2One( 'purchase.product_supplier', "Supplier's Product", domain=[ @@ -267,16 +255,14 @@ states={ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'line', -}, -depends=['product', 'party', 'state', 'action']) +}) quantity = fields.Float( "Quantity", digits='unit', states={ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'line', 'required': Eval('action') == 'line', -}, -depends=['action']) +}) unit = fields.Many2One( 'product.uom', "Unit", ondelete='RESTRICT', domain=[ @@ -286,23 +272,20 @@ 'readonly': Eval('state') != 'draft', 'invisible': Eval('action') != 'line', 'required': Bool(Eval('product')), -}, -depends=['state', 'product_uom_category', 'action', 'product']) +}) unit_price = fields.Numeric(
[tryton-commits] changeset in modules/purchase:default Send only the required fie...
changeset 9aef2dd55217 in modules/purchase:default details: https://hg.tryton.org/modules/purchase?cmd=changeset=9aef2dd55217 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: configuration.py | 3 +- party.py | 4 +- product.py | 15 -- purchase.py | 81 --- stock.py | 6 +-- 5 files changed, 40 insertions(+), 69 deletions(-) diffs (388 lines): diff -r 5e347d0dfbb5 -r 9aef2dd55217 configuration.py --- a/configuration.py Wed Apr 06 23:37:43 2022 +0200 +++ b/configuration.py Fri Apr 08 19:07:13 2022 +0200 @@ -70,8 +70,7 @@ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id('purchase', 'sequence_type_purchase')), -], -depends=['company']) +]) @classmethod def __register__(cls, module_name): diff -r 5e347d0dfbb5 -r 9aef2dd55217 party.py --- a/party.py Wed Apr 06 23:37:43 2022 +0200 +++ b/party.py Fri Apr 08 19:07:13 2022 +0200 @@ -39,7 +39,7 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) customer_code = fields.Char('Customer Code') @@ -51,7 +51,7 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) supplier_lead_time = fields.TimeDelta("Lead Time") diff -r 5e347d0dfbb5 -r 9aef2dd55217 product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -30,14 +30,12 @@ }, domain=[ If(~Eval('active'), ('active', '=', False), ()), -], -depends=['purchasable', 'active']) +]) purchase_uom = fields.Many2One('product.uom', 'Purchase UOM', states={ 'invisible': ~Eval('purchasable'), 'required': Eval('purchasable', False), }, -domain=[('category', '=', Eval('default_uom_category'))], -depends=['purchasable', 'default_uom_category']) +domain=[('category', '=', Eval('default_uom_category'))]) @fields.depends('default_uom', 'purchase_uom', 'purchasable') def on_change_default_uom(self): @@ -127,8 +125,7 @@ states={ 'invisible': (~Eval('purchasable', False) | ~Eval('context', {}).get('company')), -}, -depends=['template', 'purchasable', 'active']) +}) purchase_price_uom = fields.Function(fields.Numeric( "Purchase Price", digits=price_digits), 'get_purchase_price_uom') @@ -262,7 +259,7 @@ context={ 'company': Eval('company', -1), }, -depends=['product', 'active', 'company']) +depends={'company'}) product = fields.Many2One( 'product.product', "Variant", select=True, domain=[ @@ -274,14 +271,14 @@ context={ 'company': Eval('company', -1), }, -depends=['template', 'active', 'company']) +depends={'company'}) party = fields.Many2One( 'party.party', 'Supplier', required=True, ondelete='CASCADE', select=True, context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) name = fields.Char('Name', size=None, translate=True, select=True) code = fields.Char('Code', size=None, select=True) prices = fields.One2Many('purchase.product_supplier.price', diff -r 5e347d0dfbb5 -r 9aef2dd55217 purchase.py --- a/purchase.py Wed Apr 06 23:37:43 2022 +0200 +++ b/purchase.py Fri Apr 08 19:07:13 2022 +0200 @@ -73,7 +73,6 @@ _states = { 'readonly': Eval('state') != 'draft', } -_depends = ['state'] company = fields.Many2One( 'company.company', "Company", required=True, select=True, @@ -83,24 +82,20 @@ | Eval('lines', [0]) | Eval('party', True) | Eval('invoice_party', True)), -}, -depends=['state']) +}) number = fields.Char('Number', size=None, readonly=True, select=True) reference = fields.Char('Reference', select=True) -description = fields.Char('Description', size=None, states=_states, -depends=_depends) +description = fields.Char('Description', size=None, states=_states) purchase_date = fields.Date('Purchase Date', states={ 'readonly': ~Eval('state').in_(['draft', 'quotation']), 'required': ~Eval('state').in_( ['draft', 'quotation', 'cancelled']), -}, -depends=['state']) +}) payment_term = fields.Many2One('account.invoice.payment_term', 'Payment Term',
[tryton-commits] changeset in modules/project_revenue:default Send only the requi...
changeset bdee25aec797 in modules/project_revenue:default details: https://hg.tryton.org/modules/project_revenue?cmd=changeset=bdee25aec797 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: purchase.py | 2 +- work.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diffs (32 lines): diff -r 5268a7fb4825 -r bdee25aec797 purchase.py --- a/purchase.py Wed Apr 06 23:37:43 2022 +0200 +++ b/purchase.py Fri Apr 08 19:07:13 2022 +0200 @@ -15,5 +15,5 @@ states={ 'invisible': Eval('type') != 'line', }, -depends=['type', 'purchase'], +depends={'purchase'}, help="Add to the cost of the work effort.") diff -r 5268a7fb4825 -r bdee25aec797 work.py --- a/work.py Wed Apr 06 23:37:43 2022 +0200 +++ b/work.py Fri Apr 08 19:07:13 2022 +0200 @@ -24,7 +24,7 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) list_price = Monetary( "List Price", currency='currency', digits=price_digits) revenue = fields.Function(Monetary( @@ -52,8 +52,7 @@ 'Purchase Lines', domain=[ ('purchase.company', '=', Eval('company', -1)), ('type', '=', 'line'), -], -depends=['company']) +]) @classmethod def _get_cost(cls, works):
[tryton-commits] changeset in modules/project_plan:default Send only the required...
changeset 42142a69aed7 in modules/project_plan:default details: https://hg.tryton.org/modules/project_plan?cmd=changeset=42142a69aed7 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: work.py | 12 +--- 1 files changed, 5 insertions(+), 7 deletions(-) diffs (41 lines): diff -r cabc709f8c93 -r 42142a69aed7 work.py --- a/work.py Wed Apr 06 23:37:43 2022 +0200 +++ b/work.py Fri Apr 08 19:07:13 2022 +0200 @@ -22,21 +22,19 @@ domain=[ ('parent', '=', Eval('parent', -1)), ('id', '!=', Eval('id', -1)), -], -depends=['parent', 'id']) +]) successors = fields.Many2Many('project.predecessor_successor', 'predecessor', 'successor', 'Successors', domain=[ ('parent', '=', Eval('parent', -1)), ('id', '!=', Eval('id', -1)), -], -depends=['parent', 'id']) +]) leveling_delay = fields.Float("Leveling Delay", required=True) back_leveling_delay = fields.Float("Back Leveling Delay", required=True) allocations = fields.One2Many('project.allocation', 'work', 'Allocations', states={ 'invisible': Eval('type') != 'task', -}, depends=['type']) +}) duration = fields.Function( fields.TimeDelta('Duration', 'company_work_time'), 'get_function_fields') @@ -61,10 +59,10 @@ actual_finish_date = fields.Function(fields.Date('Actual Finish'), 'get_function_fields', setter='set_function_fields') constraint_start_date = fields.Function(fields.Date('Constraint Start', -depends=['type']), 'get_function_fields', +depends={'type'}), 'get_function_fields', setter='set_function_fields') constraint_finish_date = fields.Function(fields.Date('Constraint Finish', -depends=['type']), 'get_function_fields', +depends={'type'}), 'get_function_fields', setter='set_function_fields') @classmethod
[tryton-commits] changeset in modules/project_invoice:default Send only the requi...
changeset ecea971a91c9 in modules/project_invoice:default details: https://hg.tryton.org/modules/project_invoice?cmd=changeset=ecea971a91c9 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: project.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 8e9563231cde -r ecea971a91c9 project.py --- a/project.pyWed Apr 06 23:37:43 2022 +0200 +++ b/project.pyFri Apr 08 19:07:13 2022 +0200 @@ -232,7 +232,7 @@ ()), ] if 'invoice_method' not in cls.product.depends: -cls.product.depends.append('invoice_method') +cls.product.depends.add('invoice_method') @fields.depends('type', 'project_invoice_timesheet_up_to', 'parent', '_parent_parent.invoice_timesheet_up_to')
[tryton-commits] changeset in modules/project:default Send only the required fiel...
changeset dc5037f9beee in modules/project:default details: https://hg.tryton.org/modules/project?cmd=changeset=dc5037f9beee description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: work.py | 19 +++ 1 files changed, 7 insertions(+), 12 deletions(-) diffs (57 lines): diff -r 8d65d420aa67 -r dc5037f9beee work.py --- a/work.py Wed Apr 06 23:37:43 2022 +0200 +++ b/work.py Fri Apr 08 19:07:13 2022 +0200 @@ -136,12 +136,12 @@ context={ 'company': Eval('company', -1), }, -depends=['type', 'company']) +depends={'company'}) party_address = fields.Many2One('party.address', 'Contact Address', domain=[('party', '=', Eval('party'))], states={ 'invisible': Eval('type') != 'project', -}, depends=['party', 'type']) +}) timesheet_works = fields.One2Many( 'timesheet.work', 'origin', 'Timesheet Works', readonly=True, size=1) timesheet_available = fields.Function( @@ -150,14 +150,12 @@ timesheet_start_date = fields.Function(fields.Date('Timesheet Start', states={ 'invisible': ~Eval('timesheet_available'), -}, -depends=['timesheet_available']), +}), 'get_timesheet_date', setter='set_timesheet_date') timesheet_end_date = fields.Function(fields.Date('Timesheet End', states={ 'invisible': ~Eval('timesheet_available'), -}, -depends=['timesheet_available']), +}), 'get_timesheet_date', setter='set_timesheet_date') timesheet_duration = fields.Function(fields.TimeDelta('Duration', 'company_work_time', @@ -191,18 +189,15 @@ 'project.work', 'Parent', path='path', ondelete='RESTRICT', domain=[ ('company', '=', Eval('company', -1)), -], -depends=['company']) +]) path = fields.Char("Path", select=True) children = fields.One2Many('project.work', 'parent', 'Children', domain=[ ('company', '=', Eval('company', -1)), -], -depends=['company']) +]) status = fields.Many2One( 'project.work.status', "Status", required=True, select=True, -domain=[If(Bool(Eval('type')), ('types', 'in', Eval('type')), ())], -depends=['type']) +domain=[If(Bool(Eval('type')), ('types', 'in', Eval('type')), ())]) @staticmethod def default_type():
[tryton-commits] changeset in modules/production_work_timesheet:default Send only...
changeset d05ec485ae51 in modules/production_work_timesheet:default details: https://hg.tryton.org/modules/production_work_timesheet?cmd=changeset=d05ec485ae51 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: work.py | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diffs (13 lines): diff -r 617f9bd85f0a -r d05ec485ae51 work.py --- a/work.py Wed Apr 06 23:37:43 2022 +0200 +++ b/work.py Fri Apr 08 19:07:13 2022 +0200 @@ -27,8 +27,7 @@ domain=[ ('company', '=', Eval('company', -1)), ('work', '=', Eval('timesheet_work', -1)), -], -depends=['timesheet_works', 'timesheet_work', 'company']), +]), 'get_timesheet_lines', setter='set_timesheet_lines') def get_timesheet_work(self, name):
[tryton-commits] changeset in modules/production_work:default Send only the requi...
changeset 8fac6f7c59cf in modules/production_work:default details: https://hg.tryton.org/modules/production_work?cmd=changeset=8fac6f7c59cf description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: production.py | 6 ++ work.py | 24 2 files changed, 10 insertions(+), 20 deletions(-) diffs (96 lines): diff -r d2f1b7710d59 -r 8fac6f7c59cf production.py --- a/production.py Wed Apr 06 23:37:43 2022 +0200 +++ b/production.py Fri Apr 08 19:07:13 2022 +0200 @@ -25,8 +25,7 @@ domain=[ ('company', '=', Eval('company', -1)), ('warehouse', '=', Eval('warehouse', -1)), -], -depends=['routing', 'company', 'warehouse', 'state']) +]) works = fields.One2Many('production.work', 'production', 'Works', states={ 'readonly': Eval('state').in_( @@ -34,8 +33,7 @@ }, domain=[ ('company', '=', Eval('company', -1)), -], -depends=['state', 'company']) +]) def get_cost(self, name): pool = Pool() diff -r d2f1b7710d59 -r 8fac6f7c59cf work.py --- a/work.py Wed Apr 06 23:37:43 2022 +0200 +++ b/work.py Fri Apr 08 19:07:13 2022 +0200 @@ -32,20 +32,17 @@ domain=[ ('company', '=', Eval('company', -1)), ('warehouse', '=', Eval('warehouse', -1)), -], -depends=['company', 'warehouse']) +]) children = fields.One2Many('production.work.center', 'parent', 'Children', domain=[ ('company', '=', Eval('company', -1)), ('warehouse', '=', Eval('warehouse', -1)), -], -depends=['company', 'warehouse']) +]) category = fields.Many2One('production.work.center.category', 'Category') cost_price = fields.Numeric('Cost Price', digits=price_digits, states={ 'required': Bool(Eval('cost_method')), -}, -depends=['cost_method']) +}) cost_method = fields.Selection([ ('', ''), ('cycle', 'Per Cycle'), @@ -53,8 +50,7 @@ ], 'Cost Method', states={ 'required': Bool(Eval('cost_price')), -}, -depends=['cost_price']) +}) company = fields.Many2One('company.company', 'Company', required=True, select=True) warehouse = fields.Many2One('stock.location', 'Warehouse', required=True, @@ -108,8 +104,7 @@ select=True, ondelete='CASCADE', domain=[ ('company', '=', Eval('company', -1)), -], -depends=['company']) +]) work_center_category = fields.Function(fields.Many2One( 'production.work.center.category', 'Work Center Category'), 'on_change_with_work_center_category') @@ -123,13 +118,11 @@ ], states={ 'required': ~Eval('state').in_(['request', 'draft']), -}, -depends=['work_center_category', 'company', 'warehouse', 'state']) +}) cycles = fields.One2Many('production.work.cycle', 'work', 'Cycles', states={ 'readonly': Eval('state').in_(['request', 'done']), -}, -depends=['state']) +}) active_cycles = fields.One2Many( 'production.work.cycle', 'work', "Active Cycles", readonly=True, @@ -283,8 +276,7 @@ states={ 'required': Eval('state') == 'done', 'readonly': Eval('state').in_(['done', 'draft', 'cancelled']), -}, -depends=['state']) +}) cost = fields.Numeric('Cost', digits=price_digits, readonly=True) state = fields.Selection([ ('draft', 'Draft'),
[tryton-commits] changeset in modules/production_split:default Send only the requ...
changeset 7db105906d1b in modules/production_split:default details: https://hg.tryton.org/modules/production_split?cmd=changeset=7db105906d1b description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: production.py | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diffs (12 lines): diff -r 28f5e95ed2a4 -r 7db105906d1b production.py --- a/production.py Wed Apr 06 23:37:43 2022 +0200 +++ b/production.py Fri Apr 08 19:07:13 2022 +0200 @@ -99,7 +99,6 @@ uom = fields.Many2One('product.uom', 'Uom', required=True, domain=[ ('category', '=', Eval('uom_category')), -], -depends=['uom_category']) +]) uom_category = fields.Many2One('product.uom.category', 'Uom Category', readonly=True)
[tryton-commits] changeset in modules/production_routing:default Send only the re...
changeset aebdc6a7a33f in modules/production_routing:default details: https://hg.tryton.org/modules/production_routing?cmd=changeset=aebdc6a7a33f description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py| 6 ++ production.py | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diffs (33 lines): diff -r a26492234084 -r aebdc6a7a33f product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -11,8 +11,7 @@ ondelete='CASCADE', select=True, domain=[ ('boms', '=', Eval('bom', 0)), -], -depends=['bom']) +]) class ProductionLeadTime(metaclass=PoolMeta): @@ -21,5 +20,4 @@ ondelete='CASCADE', domain=[ ('boms', '=', Eval('bom', 0)), -], -depends=['bom']) +]) diff -r a26492234084 -r aebdc6a7a33f production.py --- a/production.py Wed Apr 06 23:37:43 2022 +0200 +++ b/production.py Fri Apr 08 19:07:13 2022 +0200 @@ -14,8 +14,7 @@ states={ 'readonly': ~Eval('state').in_(['request', 'draft']), 'invisible': ~Eval('bom'), -}, -depends=['bom', 'state']) +}) @fields.depends('bom', 'routing') def on_change_bom(self):
[tryton-commits] changeset in modules/production_outsourcing:default Send only th...
changeset 94ff6862211f in modules/production_outsourcing:default details: https://hg.tryton.org/modules/production_outsourcing?cmd=changeset=94ff6862211f description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: production.py | 5 + purchase.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diffs (45 lines): diff -r 48be5cb29be0 -r 94ff6862211f production.py --- a/production.py Wed Apr 06 23:37:43 2022 +0200 +++ b/production.py Fri Apr 08 19:07:13 2022 +0200 @@ -29,7 +29,7 @@ 'required': Bool(Eval('supplier')), 'invisible': ~Eval('supplier'), }, -depends=['supplier', 'supplier_service_supplier'], +depends={'supplier_service_supplier'}, help="The service to buy to the supplier for the production.") supplier_service_supplier = fields.Many2One( 'purchase.product_supplier', "Supplier's Service", @@ -50,14 +50,12 @@ states={ 'invisible': ~Eval('supplier'), }, -depends=['supplier_service', 'supplier'], help="The supplier's service to buy for the production.") supplier_quantity = fields.Float("Quantity", states={ 'invisible': ~Eval('supplier_service'), 'required': Bool(Eval('supplier_service')), }, -depends=['supplier_service'], help="The quantity to buy to produce one time the BOM.") @classmethod @@ -111,7 +109,6 @@ domain=[ ('purchase.company', '=', Eval('company', -1)), ], -depends=['company'], help="The lines to add to the production cost.") def get_cost(self, name): diff -r 48be5cb29be0 -r 94ff6862211f purchase.py --- a/purchase.py Wed Apr 06 23:37:43 2022 +0200 +++ b/purchase.py Fri Apr 08 19:07:13 2022 +0200 @@ -16,5 +16,5 @@ states={ 'invisible': Eval('type') != 'line', }, -depends=['type', 'purchase'], +depends={'purchase'}, help="Add to the cost of the production.")
[tryton-commits] changeset in modules/production:default Send only the required f...
changeset 7b42dfdc452d in modules/production:default details: https://hg.tryton.org/modules/production?cmd=changeset=7b42dfdc452d description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: bom.py | 6 +++--- configuration.py | 3 +-- product.py | 12 production.py| 41 ++--- stock.py | 14 -- 5 files changed, 26 insertions(+), 50 deletions(-) diffs (268 lines): diff -r 8e55d7349980 -r 7b42dfdc452d bom.py --- a/bom.pyWed Apr 06 23:37:43 2022 +0200 +++ b/bom.pyFri Apr 08 19:07:13 2022 +0200 @@ -53,7 +53,7 @@ uom = fields.Many2One('product.uom', 'Uom', required=True, domain=[ ('category', '=', Eval('uom_category')), -], depends=['uom_category']) +]) quantity = fields.Float('Quantity', digits='uom', required=True, domain=['OR', ('quantity', '>=', 0), @@ -190,13 +190,13 @@ uom = fields.Many2One('product.uom', 'Unit', required=True, domain=[ ('category', '=', Eval('category')), -], depends=['category']) +]) category = fields.Many2One('product.uom.category', 'Category', readonly=True) bom = fields.Many2One('product.product-production.bom', 'BOM', required=True, domain=[ ('product', '=', Eval('product')), -], depends=['product']) +]) product = fields.Many2One('product.product', 'Product', readonly=True) diff -r 8e55d7349980 -r 7b42dfdc452d configuration.py --- a/configuration.py Wed Apr 06 23:37:43 2022 +0200 +++ b/configuration.py Fri Apr 08 19:07:13 2022 +0200 @@ -38,8 +38,7 @@ ('company', 'in', [Eval('company', -1), None]), ('sequence_type', '=', Id('production', 'sequence_type_production')), -], -depends=['company']) +]) @classmethod def __register__(cls, module_name): diff -r 8e55d7349980 -r 7b42dfdc452d product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -18,7 +18,6 @@ cls.producible.states = { 'invisible': ~Eval('type').in_(cls.get_producible_types()), } -cls.producible.depends = ['type'] @classmethod def get_producible_types(cls): @@ -39,14 +38,12 @@ 'BOMs', order=[('sequence', 'ASC'), ('id', 'ASC')], states={ 'invisible': ~Eval('producible') -}, -depends=['producible']) +}) lead_times = fields.One2Many('production.lead_time', 'product', 'Lead Times', order=[('sequence', 'ASC'), ('id', 'ASC')], states={ 'invisible': ~Eval('producible'), -}, -depends=['producible']) +}) @classmethod def validate(cls, products): @@ -93,7 +90,7 @@ ('output_products', '=', If(Bool(Eval('product')), Eval('product', 0), Get(Eval('_parent_product', {}), 'id', 0))), -], depends=['product']) +]) def get_rec_name(self, name): return self.bom.rec_name @@ -117,8 +114,7 @@ ('output_products', '=', If(Bool(Eval('product')), Eval('product', -1), Get(Eval('_parent_product', {}), 'id', 0))), -], -depends=['product']) +]) lead_time = fields.TimeDelta('Lead Time') @classmethod diff -r 8e55d7349980 -r 7b42dfdc452d production.py --- a/production.py Wed Apr 06 23:37:43 2022 +0200 +++ b/production.py Fri Apr 08 19:07:13 2022 +0200 @@ -32,34 +32,28 @@ reference = fields.Char('Reference', select=1, states={ 'readonly': ~Eval('state').in_(['request', 'draft']), -}, -depends=['state']) +}) planned_date = fields.Date('Planned Date', states={ 'readonly': ~Eval('state').in_(['request', 'draft']), -}, -depends=['state']) +}) effective_date = fields.Date('Effective Date', states={ 'readonly': Eval('state').in_(['cancelled', 'done']), -}, -depends=['state']) +}) planned_start_date = fields.Date('Planned Start Date', states={ 'readonly': ~Eval('state').in_(['request', 'draft']), 'required': Bool(Eval('planned_date')), -}, -depends=['state', 'planned_date']) +}) effective_start_date = fields.Date('Effective Start Date', states={ 'readonly': Eval('state').in_(['cancelled', 'running', 'done']), -}, -depends=['state']) +}) company = fields.Many2One('company.company', 'Company', required=True, states={
[tryton-commits] changeset in modules/product_price_list_dates:default Send only ...
changeset 19e462b51a28 in modules/product_price_list_dates:default details: https://hg.tryton.org/modules/product_price_list_dates?cmd=changeset=19e462b51a28 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diffs (22 lines): diff -r c9679aaeb198 -r 19e462b51a28 product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -31,16 +31,14 @@ If(Eval('start_date') & Eval('end_date'), ('start_date', '<=', Eval('end_date')), ()), -], -depends=['end_date']) +]) end_date = fields.Date( "End Date", domain=[ If(Eval('start_date') & Eval('end_date'), ('end_date', '>=', Eval('start_date')), ()), -], -depends=['start_date']) +]) def match(self, pattern): pool = Pool()
[tryton-commits] changeset in modules/product_measurements:default Send only the ...
changeset c44c28982a20 in modules/product_measurements:default details: https://hg.tryton.org/modules/product_measurements?cmd=changeset=c44c28982a20 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 20 +--- 1 files changed, 5 insertions(+), 15 deletions(-) diffs (82 lines): diff -r c1a7577157bf -r c44c28982a20 product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -15,43 +15,37 @@ states={ 'invisible': Eval('type').in_(NON_MEASURABLE), }, -depends=['type'], help="Length for 1 default UOM.") length_uom = fields.Many2One('product.uom', 'Length UOM', domain=[('category', '=', Id('product', 'uom_cat_length'))], states={ 'invisible': Eval('type').in_(NON_MEASURABLE), 'required': Bool(Eval('length')), -}, -depends=['type', 'length']) +}) height = fields.Float( "Height", digits='height_uom', states={ 'invisible': Eval('type').in_(NON_MEASURABLE), }, -depends=['type'], help="Height for 1 default UOM.") height_uom = fields.Many2One('product.uom', 'Height UOM', domain=[('category', '=', Id('product', 'uom_cat_length'))], states={ 'invisible': Eval('type').in_(NON_MEASURABLE), 'required': Bool(Eval('height')), -}, -depends=['type', 'height']) +}) width = fields.Float( "Width", digits='width_uom', states={ 'invisible': Eval('type').in_(NON_MEASURABLE), }, -depends=['type'], help="Width for 1 default UOM.") width_uom = fields.Many2One('product.uom', 'Width UOM', domain=[('category', '=', Id('product', 'uom_cat_length'))], states={ 'invisible': Eval('type').in_(NON_MEASURABLE), 'required': Bool(Eval('width')), -}, -depends=['type', 'width']) +}) volume = fields.Float( "Volume", digits='volume_uom', states={ @@ -59,29 +53,25 @@ 'readonly': (Bool(Eval('length')) & Bool(Eval('height')) & Bool(Eval('width'))), }, -depends=['type'], help="Volume for 1 default UOM.") volume_uom = fields.Many2One('product.uom', 'Volume UOM', domain=[('category', '=', Id('product', 'uom_cat_volume'))], states={ 'invisible': Eval('type').in_(NON_MEASURABLE), 'required': Bool(Eval('volume')), -}, -depends=['type', 'volume']) +}) weight = fields.Float( "Weight", digits='weight_uom', states={ 'invisible': Eval('type').in_(NON_MEASURABLE), }, -depends=['type'], help="Weight for 1 default UOM.") weight_uom = fields.Many2One('product.uom', 'Weight UOM', domain=[('category', '=', Id('product', 'uom_cat_weight'))], states={ 'invisible': Eval('type').in_(NON_MEASURABLE), 'required': Bool(Eval('weight')), -}, -depends=['type', 'weight']) +}) @fields.depends('volume', 'volume_uom', 'length', 'length_uom',
[tryton-commits] changeset in modules/product_kit:default Send only the required ...
changeset 743f15de74de in modules/product_kit:default details: https://hg.tryton.org/modules/product_kit?cmd=changeset=743f15de74de description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: common.py | 3 +-- product.py | 11 --- 2 files changed, 5 insertions(+), 9 deletions(-) diffs (54 lines): diff -r b411c613fca2 -r 743f15de74de common.py --- a/common.py Wed Apr 06 23:37:43 2022 +0200 +++ b/common.py Fri Apr 08 19:07:13 2022 +0200 @@ -269,8 +269,7 @@ "Quantity Ratio", readonly=True, states={ 'required': ~Eval('fixed', False), -}, -depends=['fixed']) +}) price_ratio = fields.Numeric( "Price Ratio", readonly=True, required=True) diff -r b411c613fca2 -r 743f15de74de product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -147,8 +147,7 @@ If(Eval('parent_type') == 'kit', ('type', '=', 'goods'), ()), -], -depends=['parent_type']) +]) product_unit_category = fields.Function( fields.Many2One('product.uom.category', "Product Unit Category"), 'on_change_with_product_unit_category') @@ -159,7 +158,7 @@ ('category', '=', Eval('product_unit_category')), ('category', '!=', -1)), ], -depends=['product', 'product_unit_category']) +depends={'product'}) fixed = fields.Boolean("Fixed", help="Check to make the quantity of the component independent " "of the kit quantity.") @@ -231,16 +230,14 @@ If(Bool(Eval('parent_product')), ('products', '=', Eval('parent_product')), ()), -], -depends=['parent_product']) +]) parent_product = fields.Many2One( 'product.product', "Parent Variant", ondelete='CASCADE', select=True, domain=[ If(Bool(Eval('parent_template')), ('template', '=', Eval('parent_template')), ()), -], -depends=['parent_template']) +]) @classmethod def __setup__(cls):
[tryton-commits] changeset in modules/product_image_attribute:default Send only t...
changeset bda2a0bae52e in modules/product_image_attribute:default details: https://hg.tryton.org/modules/product_image_attribute?cmd=changeset=bda2a0bae52e description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diffs (20 lines): diff -r d67ddd7d1440 -r bda2a0bae52e product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -33,14 +33,12 @@ ], states={ 'invisible': ~Eval('attribute_set') | Eval('product'), -}, -depends=['attribute_set', 'product']) +}) attributes_name = fields.Function(fields.Char( "Attributes Name", states={ 'invisible': ~Eval('attribute_set'), -}, -depends=['attribute_set']), +}), 'on_change_with_attributes_name') attribute_set = fields.Function(
[tryton-commits] changeset in modules/product_image:default Send only the require...
changeset c37f88a4b75e in modules/product_image:default details: https://hg.tryton.org/modules/product_image?cmd=changeset=c37f88a4b75e description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diffs (32 lines): diff -r 5d334e570cab -r c37f88a4b75e product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -86,8 +86,7 @@ 'product.image', 'product', "Images", domain=[ ('template', '=', Eval('template', -1)), -], -depends=['template']) +]) @property def images_used(self): @@ -114,16 +113,14 @@ If(Bool(Eval('product')), ('products', '=', Eval('product')), ()), -], -depends=['product']) +]) product = fields.Many2One( 'product.product', "Variant", select=True, domain=[ If(Bool(Eval('template')), ('template', '=', Eval('template')), ()), -], -depends=['template']) +]) cache = fields.One2Many( 'product.image.cache', 'product_image', "Cache", readonly=True)
[tryton-commits] changeset in modules/product_cost_warehouse:default Send only th...
changeset 88dadddaeb56 in modules/product_cost_warehouse:default details: https://hg.tryton.org/modules/product_cost_warehouse?cmd=changeset=88dadddaeb56 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: account.py | 3 +-- product.py | 6 ++ stock.py | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diffs (46 lines): diff -r f9f27167978b -r 88dadddaeb56 account.py --- a/account.pyWed Apr 06 23:37:43 2022 +0200 +++ b/account.pyFri Apr 08 19:07:13 2022 +0200 @@ -11,5 +11,4 @@ def __setup__(cls): super().__setup__() cls.product.context['warehouse'] = Eval('warehouse', -1) -if 'warehouse' not in cls.product.depends: -cls.product.depends.append('warehouse') +cls.product.depends.add('warehouse') diff -r f9f27167978b -r 88dadddaeb56 product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -192,8 +192,7 @@ ], states={ 'required': Eval('warehouse_required', False), -}, -depends=['warehouse_required']) +}) warehouse_required = fields.Function(fields.Boolean( "Warehouse Required"), 'get_warehouse_required') @@ -211,8 +210,7 @@ ], states={ 'required': Eval('warehouse_required', False), -}, -depends=['warehouse_required']) +}) warehouse_required = fields.Function(fields.Boolean( "Warehouse Required"), 'get_warehouse_required') diff -r f9f27167978b -r 88dadddaeb56 stock.py --- a/stock.py Wed Apr 06 23:37:43 2022 +0200 +++ b/stock.py Fri Apr 08 19:07:13 2022 +0200 @@ -48,8 +48,7 @@ (Eval('type') != 'storage') | Bool(Eval('warehouse')) | (Eval('id', -1) < 0)), -}, -depends=['type', 'warehouse']) +}) class Move(metaclass=PoolMeta):
[tryton-commits] changeset in modules/product_attribute:default Send only the req...
changeset 33b77d7d8950 in modules/product_attribute:default details: https://hg.tryton.org/modules/product_attribute?cmd=changeset=33b77d7d8950 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diffs (20 lines): diff -r eb616b953a46 -r 33b77d7d8950 product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -50,14 +50,13 @@ 'readonly': (~Eval('attribute_set') & ~Eval('_parent_template', {}).get('attribute_set')), }, -depends=['attribute_set', 'template'], +depends={'template'}, help="Add attributes to the variant.") attributes_name = fields.Function(fields.Char( "Attributes Name", states={ 'invisible': ~Eval('attribute_set'), -}, -depends=['attribute_set']), +}), 'on_change_with_attributes_name') @fields.depends('attribute_set', 'attributes')
[tryton-commits] changeset in modules/product:default Send only the required fiel...
changeset b0e8f1a28f68 in modules/product:default details: https://hg.tryton.org/modules/product?cmd=changeset=b0e8f1a28f68 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: product.py | 16 uom.py | 1 - 2 files changed, 4 insertions(+), 13 deletions(-) diffs (98 lines): diff -r 5a9354b2ed88 -r b0e8f1a28f68 product.py --- a/product.pyWed Apr 06 23:37:43 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -63,14 +63,12 @@ "Code", select=True, states={ 'readonly': Eval('code_readonly', False), -}, -depends=['code_readonly']) +}) type = fields.Selection(TYPES, "Type", required=True) consumable = fields.Boolean('Consumable', states={ 'invisible': Eval('type', 'goods') != 'goods', }, -depends=['type'], help="Check to allow stock moves to be assigned " "regardless of stock level.") list_price = fields.MultiValue(fields.Numeric( @@ -114,7 +112,6 @@ domain=[ If(~Eval('active'), ('active', '=', False), ()), ], -depends=['active'], help="The different variants the product comes in.") @classmethod @@ -138,7 +135,6 @@ cls.cost_price_method.domain = [ Get(types_cost_method, Eval('type'), []), ] -cls.cost_price_method.depends = ['type'] @classmethod def _cost_price_method_domain_per_type(cls): @@ -339,7 +335,6 @@ domain=[ If(Eval('active'), ('active', '=', True), ()), ], -depends=['active'], help="The product that defines the common properties " "inherited by the variant.") code_readonly = fields.Function(fields.Boolean('Code Readonly'), @@ -355,7 +350,6 @@ states={ 'readonly': Eval('code_readonly', False), }, -depends=['code_readonly'], help="The unique identifier for the product (aka SKU).") code = fields.Char("Code", readonly=True, select=True, help="A unique identifier for the variant.") @@ -414,8 +408,6 @@ tfield.states['invisible'] |= invisible_state else: tfield.states['invisible'] = invisible_state -if 'template' not in tfield.depends: -tfield.depends.append('template') setattr(cls, attr, TemplateFunction(tfield)) order_method = getattr(cls, 'order_%s' % attr, None) if (not order_method @@ -634,7 +626,7 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) list_price = fields.Numeric("List Price", digits=price_digits) @classmethod @@ -669,7 +661,7 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) cost_price_method = fields.Selection( 'get_cost_price_methods', "Cost Price Method") @@ -729,7 +721,7 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) cost_price = fields.Numeric( "Cost Price", required=True, digits=price_digits) diff -r 5a9354b2ed88 -r b0e8f1a28f68 uom.py --- a/uom.pyWed Apr 06 23:37:43 2022 +0200 +++ b/uom.pyFri Apr 08 19:07:13 2022 +0200 @@ -57,7 +57,6 @@ domain=[ ('rounding', '>', 0), ], -depends=['digits'], help="The accuracy to which values are rounded.") digits = fields.Integer( "Display Digits", required=True,
[tryton-commits] changeset in modules/party:default Send only the required fields...
changeset b93652467c11 in modules/party:default details: https://hg.tryton.org/modules/party?cmd=changeset=b93652467c11 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: address.py | 9 +++-- contact_mechanism.py | 14 +++--- party.py | 4 3 files changed, 10 insertions(+), 17 deletions(-) diffs (116 lines): diff -r 94fd562eb13e -r b93652467c11 address.py --- a/address.pyWed Apr 06 23:37:43 2022 +0200 +++ b/address.pyFri Apr 08 19:07:13 2022 +0200 @@ -28,8 +28,7 @@ party = fields.Many2One('party.party', 'Party', required=True, ondelete='CASCADE', select=True, states={ 'readonly': Eval('id', 0) > 0, -}, -depends=['id']) +}) party_name = fields.Char( "Party Name", help="If filled, replace the name of the party for address formatting") @@ -54,8 +53,7 @@ ('type', 'in', Eval('subdivision_types', [])), () ), -], -depends=['country', 'subdivision_types']) +]) full_address = fields.Function(fields.Text('Full Address'), 'get_full_address') identifiers = fields.One2Many( @@ -63,8 +61,7 @@ domain=[ ('party', '=', Eval('party')), ('type', 'in', ['fr_siret']), -], -depends=['party']) +]) @classmethod def __setup__(cls): diff -r 94fd562eb13e -r b93652467c11 contact_mechanism.py --- a/contact_mechanism.py Wed Apr 06 23:37:43 2022 +0200 +++ b/contact_mechanism.py Fri Apr 08 19:07:13 2022 +0200 @@ -48,9 +48,9 @@ type = fields.Selection(_TYPES, "Type", required=True, sort=False) value = fields.Char("Value", select=True, # Add all function fields to ensure to always fill them via on_change -depends=[ +depends={ 'email', 'website', 'skype', 'sip', 'other_value', -'value_compact']) +'value_compact'}) value_compact = fields.Char('Value Compact', readonly=True) name = fields.Char("Name") comment = fields.Text("Comment") @@ -66,27 +66,27 @@ email = fields.Function(fields.Char('E-Mail', states={ 'invisible': Eval('type') != 'email', 'required': Eval('type') == 'email', -}, depends=['value', 'type']), +}, depends={'value'}), 'get_value', setter='set_value') website = fields.Function(fields.Char('Website', states={ 'invisible': Eval('type') != 'website', 'required': Eval('type') == 'website', -}, depends=['value', 'type']), +}, depends={'value'}), 'get_value', setter='set_value') skype = fields.Function(fields.Char('Skype', states={ 'invisible': Eval('type') != 'skype', 'required': Eval('type') == 'skype', -}, depends=['value', 'type']), +}, depends={'value'}), 'get_value', setter='set_value') sip = fields.Function(fields.Char('SIP', states={ 'invisible': Eval('type') != 'sip', 'required': Eval('type') == 'sip', -}, depends=['value', 'type']), +}, depends={'value'}), 'get_value', setter='set_value') other_value = fields.Function(fields.Char('Value', states={ 'invisible': Eval('type').in_(['email', 'website', 'skype', 'sip']), 'required': ~Eval('type').in_(['email', 'website']), -}, depends=['value', 'type']), +}, depends={'value'}), 'get_value', setter='set_value') url = fields.Function(fields.Char('URL', states={ 'invisible': ~Eval('url'), diff -r 94fd562eb13e -r b93652467c11 party.py --- a/party.py Wed Apr 06 23:37:43 2022 +0200 +++ b/party.py Fri Apr 08 19:07:13 2022 +0200 @@ -39,7 +39,6 @@ states={ 'readonly': Eval('code_readonly', True), }, -depends=['code_readonly'], help="The unique identifier of the party.") code_readonly = fields.Function(fields.Boolean('Code Readonly'), 'get_code_readonly') @@ -98,7 +97,6 @@ cls.active.states.update({ 'readonly': Bool(Eval('replaced_by')), }) -cls.active.depends.append('replaced_by') @classmethod def __register__(cls, module_name): @@ -627,7 +625,6 @@ domain=[ ('party', '=', Eval('party', -1)), ], -depends=['party', 'type_address'], help="The address identified by this record.") type = fields.Selection('get_types', 'Type') type_string = type.translated('type') @@ -893,7 +890,6 @@ domain=[ ('id', '!=', Eval('source', -1)), ], -depends=['source'], help="The party that replaces.") @classmethod
[tryton-commits] changeset in modules/notification_email:default Send only the re...
changeset 27903c92c2c3 in modules/notification_email:default details: https://hg.tryton.org/modules/notification_email?cmd=changeset=27903c92c2c3 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: ir.py | 3 +-- notification.py | 11 +-- 2 files changed, 2 insertions(+), 12 deletions(-) diffs (86 lines): diff -r 03131d84632e -r 27903c92c2c3 ir.py --- a/ir.py Wed Apr 06 23:37:43 2022 +0200 +++ b/ir.py Fri Apr 08 19:07:13 2022 +0200 @@ -13,8 +13,7 @@ states={ 'required': Eval('notification_email_required', False), 'invisible': ~Eval('notification_email_required', False), -}, -depends=['notification_email_required']) +}) notification_email_required = fields.Function( fields.Boolean("Notification Email Required"), 'on_change_with_notification_email_required') diff -r 03131d84632e -r 27903c92c2c3 notification.py --- a/notification.py Wed Apr 06 23:37:43 2022 +0200 +++ b/notification.py Fri Apr 08 19:07:13 2022 +0200 @@ -43,7 +43,6 @@ domain=[ ('model.model', '=', Eval('model')), ], -depends=['model'], help="The field that contains the recipient(s).") fallback_recipients = fields.Many2One( 'res.user', "Recipients Fallback User", @@ -53,14 +52,12 @@ states={ 'invisible': ~Eval('recipients'), }, -depends=['recipients'], help="User notified when no recipients e-mail is found") recipients_secondary = fields.Many2One( 'ir.model.field', "Secondary Recipients", domain=[ ('model.model', '=', Eval('model')), ], -depends=['model'], help="The field that contains the secondary recipient(s).") fallback_recipients_secondary = fields.Many2One( 'res.user', "Secondary Recipients Fallback User", @@ -70,14 +67,12 @@ states={ 'invisible': ~Eval('recipients_secondary'), }, -depends=['recipients'], help="User notified when no secondary recipients e-mail is found") recipients_hidden = fields.Many2One( 'ir.model.field', "Hidden Recipients", domain=[ ('model.model', '=', Eval('model')), ], -depends=['model'], help="The field that contains the hidden recipient(s).") fallback_recipients_hidden = fields.Many2One( 'res.user', "Hidden Recipients Fallback User", @@ -87,7 +82,6 @@ states={ 'invisible': ~Eval('recipients_hidden'), }, -depends=['recipients_hidden'], help="User notified when no hidden recipients e-mail is found") contact_mechanism = fields.Selection( @@ -104,13 +98,11 @@ domain=[ ('model', '=', Eval('model')), ], -depends=['model'], help="The reports used as attachments.") triggers = fields.One2Many( 'ir.trigger', 'notification_email', "Triggers", domain=[('model.model', '=', Eval('model'))], -depends=['model'], help="Add a trigger for the notification.") send_after = fields.TimeDelta( "Send After", @@ -346,8 +338,7 @@ 'ir.action.report', "Report", required=True, domain=[ ('model', '=', Eval('model')), -], -depends=['model']) +]) model = fields.Function(fields.Char("Model"), 'get_model')
[tryton-commits] changeset in modules/marketing_email:default Send only the requi...
changeset 4748f746beed in modules/marketing_email:default details: https://hg.tryton.org/modules/marketing_email?cmd=changeset=4748f746beed description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: marketing.py | 15 ++- 1 files changed, 6 insertions(+), 9 deletions(-) diffs (46 lines): diff -r 316f3153b310 -r 4748f746beed marketing.py --- a/marketing.py Wed Apr 06 23:37:42 2022 +0200 +++ b/marketing.py Fri Apr 08 19:07:13 2022 +0200 @@ -314,22 +314,20 @@ _states = { 'readonly': Eval('state') != 'draft', } -_depends = ['state'] from_ = fields.Char( -"From", states=_states, depends=_depends, +"From", states=_states, help="Leave empty for the value defined in the configuration file.") list_ = fields.Many2One( 'marketing.email.list', "List", -required=True, states=_states, depends=_depends) +required=True, states=_states) title = fields.Char( -"Title", required=True, states=_states, depends=_depends) +"Title", required=True, states=_states) content = fields.Text( "Content", states={ 'required': Eval('state') != 'draft', 'readonly': _states['readonly'], -}, -depends=['state'] + _depends) +}) urls = fields.One2Many( 'web.shortened_url', 'record', "URLs", readonly=True) state = fields.Selection([ @@ -337,7 +335,7 @@ ('sending', "Sending"), ('sent', "Sent"), ], "State", readonly=True, select=True, sort=False) -del _states, _depends +del _states @classmethod def __setup__(cls): @@ -522,5 +520,4 @@ 'marketing.email', "E-Mail", required=True, domain=[ ('list_', '=', Eval('list_')), -], -depends=['list_']) +])
[tryton-commits] changeset in modules/marketing_automation:default Send only the ...
changeset f6100aec8cb7 in modules/marketing_automation:default details: https://hg.tryton.org/modules/marketing_automation?cmd=changeset=f6100aec8cb7 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: marketing_automation.py | 22 ++ 1 files changed, 6 insertions(+), 16 deletions(-) diffs (94 lines): diff -r 2125544eb448 -r f6100aec8cb7 marketing_automation.py --- a/marketing_automation.py Wed Apr 06 23:37:42 2022 +0200 +++ b/marketing_automation.py Fri Apr 08 19:07:13 2022 +0200 @@ -270,7 +270,6 @@ states={ 'invisible': ~Eval('event'), }, -depends=['event'], help="Check to execute the activity " "if the event has not happened by the end of the delay.") on = fields.Function(fields.Selection([ @@ -291,7 +290,6 @@ states={ 'required': Eval('negative', False), }, -depends=['negative'], help="After how much time the action should be executed.") action = fields.Selection([ @@ -304,7 +302,6 @@ states={ 'invisible': Eval('action') != 'send_email', }, -depends=['action'], help="Leave empty to use the value defined in the configuration file.") email_title = fields.Char( "E-Mail Title", @@ -313,7 +310,6 @@ 'invisible': Eval('action') != 'send_email', 'required': Eval('action') == 'send_email', }, -depends=['action'], help="The subject of the email.\n" "The Genshi syntax can be used " "with 'record' in the evaluation context.") @@ -324,7 +320,6 @@ 'invisible': Eval('action') != 'send_email', 'required': Eval('action') == 'send_email', }, -depends=['action'], help="The HTML content of the E-mail.\n" "The Genshi syntax can be used " "with 'record' in the evaluation context.") @@ -336,15 +331,14 @@ "E-Mails Opened", states={ 'invisible': Eval('action') != 'send_email', -}, -depends=['action']), 'get_record_count') +}), 'get_record_count') email_clicked = fields.Function( fields.Integer( "E-Mails Clicked", states={ 'invisible': Eval('action') != 'send_email', -}, -depends=['action']), 'get_record_count') +}), +'get_record_count') @classmethod def __setup__(cls): @@ -359,7 +353,6 @@ [(name, 'in', events + [None])], domain) field.domain = [domain] -field.depends = ['parent_action'] @classmethod def view_attributes(cls): @@ -736,20 +729,17 @@ "At", states={ 'readonly': Eval('state') != 'waiting', -}, -depends=['state']) +}) email_opened = fields.Boolean( "E-Mail Opened", states={ 'invisible': Eval('activity_action') != 'send_email', -}, -depends=['activity_action']) +}) email_clicked = fields.Boolean( "E-Mail Clicked", states={ 'invisible': Eval('activity_action') != 'send_email', -}, -depends=['activity_action']) +}) state = fields.Selection([ ('waiting', "Waiting"), ('done', "Done"),
[tryton-commits] changeset in modules/incoterm:default Send only the required fie...
changeset e1cf976199ab in modules/incoterm:default details: https://hg.tryton.org/modules/incoterm?cmd=changeset=e1cf976199ab description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: common.py | 14 +- party.py | 4 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) diffs (75 lines): diff -r 2ce3e6a1e86d -r e1cf976199ab common.py --- a/common.py Wed Apr 06 23:37:42 2022 +0200 +++ b/common.py Fri Apr 08 19:07:13 2022 +0200 @@ -26,11 +26,10 @@ @classmethod def __setup__(cls): super().__setup__() -readonly, depends = cls._incoterm_readonly_state() +readonly = cls._incoterm_readonly_state() cls.incoterm.states = { 'readonly': readonly, } -cls.incoterm.depends = depends cls.incoterm_location.states = { 'readonly': readonly, @@ -40,16 +39,15 @@ cls.incoterm_location.search_context = { 'related_party': related_party, } -cls.incoterm_location.depends = ( -depends + ['incoterm'] + related_party_depends) +cls.incoterm_location.depends = {'incoterm'} | related_party_depends @classmethod def _incoterm_readonly_state(cls): -return ~Eval('state').in_(['draft']), ['state'] +return ~Eval('state').in_(['draft']) @classmethod def _incoterm_related_party(cls): -return Eval('party'), ['party'] +return Eval('party'), {'party'} @property def incoterm_name(self): @@ -73,16 +71,14 @@ @classmethod def __setup__(cls): super().__setup__() -readonly, depends = cls._incoterm_readonly_state() +readonly = cls._incoterm_readonly_state() cls.incoterm.domain = [ If(~readonly, ('id', 'in', Eval('available_incoterms', [])), ()), ] -cls.incoterm.depends += depends + ['available_incoterms'] cls.incoterm_location.states['required'] = ( Eval('incoterm_location_required', False)) -cls.incoterm_location.depends.append('incoterm_location_required') @fields.depends('company', 'party', methods=['_get_incoterm_pattern']) def on_change_with_available_incoterms(self, name=None): diff -r 2ce3e6a1e86d -r e1cf976199ab party.py --- a/party.py Wed Apr 06 23:37:42 2022 +0200 +++ b/party.py Fri Apr 08 19:07:13 2022 +0200 @@ -94,7 +94,7 @@ context={ 'company': Eval('company', -1), }, -depends=['company']) +depends={'company'}) company = fields.Many2One('company.company', "Company") type = fields.Selection([ ('purchase', "Purchase"), @@ -111,7 +111,7 @@ ('party.distance', 'ASC NULLS LAST'), ('id', None), ], -depends=['party']) +depends={'party'}) @classmethod def __setup__(cls):
[tryton-commits] changeset in modules/customs:default Send only the required fiel...
changeset 602bf5696bd5 in modules/customs:default details: https://hg.tryton.org/modules/customs?cmd=changeset=602bf5696bd5 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: customs.py | 27 +-- product.py | 18 +- 2 files changed, 14 insertions(+), 31 deletions(-) diffs (147 lines): diff -r 2011b789107b -r 602bf5696bd5 customs.py --- a/customs.pyWed Apr 06 23:37:42 2022 +0200 +++ b/customs.pyFri Apr 08 19:07:13 2022 +0200 @@ -41,8 +41,7 @@ start_month = fields.Selection(MONTHS, 'Start Month', sort=False, states={ 'required': Eval('end_month') | Eval('start_day'), -}, -depends=['end_month', 'start_day']) +}) start_day = fields.Integer('Start Day', domain=['OR', ('start_day', '<=', If(Eval('start_month').in_( @@ -52,13 +51,11 @@ ], states={ 'required': Bool(Eval('start_month')), -}, -depends=['start_month']) +}) end_month = fields.Selection(MONTHS, 'End Month', sort=False, states={ 'required': Eval('start_month') | Eval('end_day'), -}, -depends=['start_month', 'end_day']) +}) end_day = fields.Integer('End Day', domain=['OR', ('end_day', '<=', If(Eval('end_month').in_( @@ -68,8 +65,7 @@ ], states={ 'required': Bool(Eval('end_month')), -}, -depends=['end_month']) +}) duty_rates = fields.One2Many('customs.duty.rate', 'tariff_code', 'Duty Rates') @@ -116,15 +112,13 @@ ('start_date', '<=', If(Bool(Eval('end_date')), Eval('end_date', datetime.date.max), datetime.date.max)), ('start_date', '=', None), -], -depends=['end_date']) +]) end_date = fields.Date('End Date', domain=['OR', ('end_date', '>=', If(Bool(Eval('start_date')), Eval('start_date', datetime.date.min), datetime.date.min)), ('end_date', '=', None), -], -depends=['start_date']) +]) computation_type = fields.Selection([ ('amount', 'Amount'), ('quantity', 'Quantity'), @@ -133,20 +127,17 @@ states={ 'required': Eval('computation_type').in_(['amount', 'quantity']), 'invisible': ~Eval('computation_type').in_(['amount', 'quantity']), -}, -depends=['computation_type']) +}) currency = fields.Many2One('currency.currency', 'Currency', states={ 'required': Eval('computation_type').in_(['amount', 'quantity']), 'invisible': ~Eval('computation_type').in_(['amount', 'quantity']), -}, -depends=['computation_type']) +}) uom = fields.Many2One('product.uom', 'Uom', states={ 'required': Eval('computation_type') == 'quantity', 'invisible': Eval('computation_type') != 'quantity', -}, -depends=['computation_type']) +}) @classmethod def __setup__(cls): diff -r 2011b789107b -r 602bf5696bd5 product.py --- a/product.pyWed Apr 06 23:37:42 2022 +0200 +++ b/product.pyFri Apr 08 19:07:13 2022 +0200 @@ -13,21 +13,18 @@ customs = fields.Boolean('Customs', select=True, states={ 'readonly': Bool(Eval('childs', [0])) | Bool(Eval('parent')), -}, -depends=['parent']) +}) tariff_codes_parent = fields.Boolean("Use Parent's Tariff Codes", states={ 'invisible': ~Eval('customs', False), }, -depends=['customs'], help='Use the tariff codes defined on the parent category.') tariff_codes = fields.One2Many('product-customs.tariff.code', 'product', 'Tariff Codes', order=[('sequence', 'ASC'), ('id', 'ASC')], states={ 'invisible': (Eval('tariff_codes_parent', False) | ~Eval('customs', False)), -}, -depends=['tariff_codes_parent', 'customs']) +}) @classmethod def __setup__(cls): @@ -35,11 +32,9 @@ cls.parent.domain = [ ('customs', '=', Eval('customs', False)), cls.parent.domain or []] -cls.parent.depends.append('customs') cls.parent.states['required'] = Or( cls.parent.states.get('required', False), Eval('tariff_codes_parent', False)) -cls.parent.depends.append('tariff_codes_parent') @classmethod def default_customs(cls): @@ -100,8 +95,7 @@ ], states={ 'required': Eval('tariff_codes_category', False), -}, -depends=['tariff_codes_category'])
[tryton-commits] changeset in modules/currency_rs:default Send only the required ...
changeset 03eab07c529d in modules/currency_rs:default details: https://hg.tryton.org/modules/currency_rs?cmd=changeset=03eab07c529d description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: currency.py | 13 + 1 files changed, 5 insertions(+), 8 deletions(-) diffs (34 lines): diff -r 7404d3142137 -r 03eab07c529d currency.py --- a/currency.py Wed Apr 06 23:37:42 2022 +0200 +++ b/currency.py Fri Apr 08 19:07:13 2022 +0200 @@ -38,16 +38,15 @@ 'required': Eval('source') == 'nbs_rs', 'invisible': Eval('source') != 'nbs_rs', } -_depends = ['source'] -rs_username = fields.Char("Username", states=_states, depends=_depends) -rs_password = fields.Char("Password", states=_states, depends=_depends) -rs_license_id = fields.Char("License ID", states=_states, depends=_depends) +rs_username = fields.Char("Username", states=_states) +rs_password = fields.Char("Password", states=_states) +rs_license_id = fields.Char("License ID", states=_states) rs_list_type = fields.Selection( -'get_rs_list_types', "List Type", states=_states, depends=_depends) +'get_rs_list_types', "List Type", states=_states) _rs_list_types = Cache(__name__ + '.get_rs_list_types', context=False) -del _states, _depends +del _states @classmethod def __setup__(cls): @@ -59,8 +58,6 @@ ('code', '=', 'RSD'), ()), ] -if 'source' not in cls.currency.depends: -cls.currency.depends.append('source') @fields.depends('rs_username', 'rs_password', 'rs_license_id') def _rs_client(self):
[tryton-commits] changeset in modules/currency_ro:default Send only the required ...
changeset 827550540929 in modules/currency_ro:default details: https://hg.tryton.org/modules/currency_ro?cmd=changeset=827550540929 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: currency.py | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diffs (12 lines): diff -r 73e1c45ccd00 -r 827550540929 currency.py --- a/currency.py Wed Apr 06 23:37:42 2022 +0200 +++ b/currency.py Fri Apr 08 19:07:13 2022 +0200 @@ -29,8 +29,6 @@ ('code', '=', 'RON'), ()), ] -if 'source' not in cls.currency.depends: -cls.currency.depends.append('source') def fetch_bnr_ro(self, date): if (dt.date.today() - date).days < 10:
[tryton-commits] changeset in modules/currency:default Send only the required fie...
changeset 457954e02feb in modules/currency:default details: https://hg.tryton.org/modules/currency?cmd=changeset=457954e02feb description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: currency.py | 8 +++- fields.py | 8 2 files changed, 7 insertions(+), 9 deletions(-) diffs (50 lines): diff -r f4fa211f161d -r 457954e02feb currency.py --- a/currency.py Wed Apr 06 23:37:42 2022 +0200 +++ b/currency.py Fri Apr 08 19:07:13 2022 +0200 @@ -47,7 +47,7 @@ rates = fields.One2Many('currency.currency.rate', 'currency', 'Rates', help="Add floating exchange rates for the currency.") rounding = fields.Numeric('Rounding factor', required=True, -digits=(12, Eval('digits', 6)), depends=['digits'], +digits=(12, Eval('digits', 6)), help="The minimum amount which can be represented in this currency.") digits = fields.Integer("Digits", required=True, help="The number of digits to display after the decimal separator.") @@ -312,8 +312,7 @@ states={ 'required': Eval('frequency') == 'weekly', 'invisible': Eval('frequency') != 'weekly', -}, -depends=['frequency']) +}) day = fields.Integer( "Day of Month", domain=[If(Eval('frequency') == 'monthly', @@ -323,8 +322,7 @@ states={ 'required': Eval('frequency') == 'monthly', 'invisible': Eval('frequency') != 'monthly', -}, -depends=['frequency']) +}) currency = fields.Many2One( 'currency.currency', "Currency", required=True, help="The base currency to fetch rate.") diff -r f4fa211f161d -r 457954e02feb fields.py --- a/fields.py Wed Apr 06 23:37:42 2022 +0200 +++ b/fields.py Fri Apr 08 19:07:13 2022 +0200 @@ -19,10 +19,10 @@ ''' if currency: if depends is None: -depends = [currency] -elif currency not in depends: -depends = depends.copy() -depends.append(currency) +depends = set() +else: +depends = set(depends) +depends.add(currency) super().__init__(string=string, digits=digits, help=help, required=required, readonly=readonly, domain=domain, states=states, select=select, on_change=on_change, on_change_with=on_change_with,
[tryton-commits] changeset in modules/country:default Send only the required fiel...
changeset 11744871bc21 in modules/country:default details: https://hg.tryton.org/modules/country?cmd=changeset=11744871bc21 description: Send only the required fields when fetching a readonly view definition issue11134 review380081002 diffstat: country.py | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diffs (19 lines): diff -r 3e7052f84a97 -r 11744871bc21 country.py --- a/country.pyWed Apr 06 23:37:42 2022 +0200 +++ b/country.pyFri Apr 08 19:07:13 2022 +0200 @@ -241,7 +241,6 @@ domain=[ ('country', '=', Eval('country', -1)), ], -depends=['country'], help="Add subdivision below the parent.") @classmethod @@ -303,7 +302,6 @@ subdivision = fields.Many2One('country.subdivision', 'Subdivision', select=True, ondelete='CASCADE', domain=[('country', '=', Eval('country', -1))], -depends=['country'], help="The subdivision where the postal code is.") postal_code = fields.Char('Postal Code') city = fields.Char(