From 95456d6f92012fc95e45550f7ecf4a805c1f8175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 18 Sep 2025 16:42:29 +0200 Subject: [PATCH] Use `tryton.cfg` to register in the Pool --- .../__init__.py | 13 -- .../{{ cookiecutter.module_name }}/tryton.cfg | 7 + modules/account/__init__.py | 125 +----------------- modules/account/tryton.cfg | 109 +++++++++++++++ modules/account_asset/__init__.py | 40 ------ modules/account_asset/tryton.cfg | 34 +++++ modules/account_be/__init__.py | 14 -- modules/account_be/tryton.cfg | 7 + modules/account_budget/__init__.py | 26 +--- modules/account_budget/tryton.cfg | 12 ++ modules/account_cash_rounding/__init__.py | 25 ---- modules/account_cash_rounding/tryton.cfg | 18 +++ modules/account_consolidation/__init__.py | 22 --- modules/account_consolidation/tryton.cfg | 15 +++ modules/account_credit_limit/__init__.py | 17 --- modules/account_credit_limit/tryton.cfg | 11 ++ modules/account_de_skr03/__init__.py | 4 - modules/account_deposit/__init__.py | 24 ---- modules/account_deposit/tryton.cfg | 17 +++ modules/account_dunning/__init__.py | 24 ---- modules/account_dunning/tryton.cfg | 17 +++ modules/account_dunning_email/__init__.py | 20 --- modules/account_dunning_email/tryton.cfg | 9 ++ modules/account_dunning_fee/__init__.py | 18 --- modules/account_dunning_fee/tryton.cfg | 12 ++ modules/account_dunning_letter/__init__.py | 16 --- modules/account_dunning_letter/tryton.cfg | 8 ++ modules/account_es/__init__.py | 39 ------ modules/account_es/tryton.cfg | 33 +++++ modules/account_es_sii/__init__.py | 23 ---- modules/account_es_sii/tryton.cfg | 15 +++ modules/account_eu/__init__.py | 15 --- modules/account_eu/tryton.cfg | 7 + modules/account_export/__init__.py | 15 --- modules/account_export/tryton.cfg | 7 + modules/account_export_winbooks/__init__.py | 27 ---- modules/account_export_winbooks/tryton.cfg | 18 +++ modules/account_fr/__init__.py | 16 --- modules/account_fr/tryton.cfg | 9 ++ modules/account_fr_chorus/__init__.py | 25 ---- modules/account_fr_chorus/tryton.cfg | 13 ++ modules/account_invoice/__init__.py | 58 -------- modules/account_invoice/tryton.cfg | 50 +++++++ .../account_invoice_correction/__init__.py | 15 --- modules/account_invoice_correction/tryton.cfg | 7 + modules/account_invoice_defer/__init__.py | 23 ---- modules/account_invoice_defer/tryton.cfg | 12 ++ modules/account_invoice_history/__init__.py | 16 --- modules/account_invoice_history/tryton.cfg | 10 ++ .../__init__.py | 11 -- .../tryton.cfg | 5 + .../__init__.py | 12 -- .../account_invoice_secondary_unit/tryton.cfg | 4 + modules/account_invoice_stock/__init__.py | 14 -- modules/account_invoice_stock/tryton.cfg | 8 ++ modules/account_invoice_watermark/__init__.py | 13 -- modules/account_invoice_watermark/tryton.cfg | 5 + .../account_move_line_grouping/__init__.py | 18 --- modules/account_move_line_grouping/tryton.cfg | 9 ++ modules/account_payment/__init__.py | 47 ------- modules/account_payment/tryton.cfg | 44 ++++++ modules/account_payment_braintree/__init__.py | 29 +--- modules/account_payment_braintree/tryton.cfg | 20 +++ modules/account_payment_clearing/__init__.py | 31 ----- modules/account_payment_clearing/tryton.cfg | 25 ++++ modules/account_payment_sepa/__init__.py | 25 ---- modules/account_payment_sepa/tryton.cfg | 18 +++ .../account_payment_sepa_cfonb/__init__.py | 10 -- modules/account_payment_sepa_cfonb/tryton.cfg | 5 + modules/account_payment_stripe/__init__.py | 30 +---- modules/account_payment_stripe/tryton.cfg | 20 +++ modules/account_product/__init__.py | 27 ---- modules/account_product/tryton.cfg | 22 +++ modules/account_receivable_rule/__init__.py | 28 +--- modules/account_receivable_rule/tryton.cfg | 16 +++ modules/account_rule/__init__.py | 38 ------ modules/account_rule/tryton.cfg | 32 +++++ modules/account_statement/__init__.py | 28 ---- modules/account_statement/tryton.cfg | 20 +++ modules/account_statement_aeb43/__init__.py | 14 -- modules/account_statement_aeb43/tryton.cfg | 6 + modules/account_statement_coda/__init__.py | 17 --- modules/account_statement_coda/tryton.cfg | 6 + modules/account_statement_mt940/__init__.py | 17 --- modules/account_statement_mt940/tryton.cfg | 6 + modules/account_statement_ofx/__init__.py | 17 --- modules/account_statement_ofx/tryton.cfg | 6 + modules/account_statement_rule/__init__.py | 20 --- modules/account_statement_rule/tryton.cfg | 9 ++ modules/account_statement_sepa/__init__.py | 15 --- modules/account_statement_sepa/tryton.cfg | 6 + modules/account_stock_anglo_saxon/__init__.py | 16 --- modules/account_stock_anglo_saxon/tryton.cfg | 10 ++ modules/account_stock_continental/__init__.py | 18 --- modules/account_stock_continental/tryton.cfg | 13 ++ modules/account_stock_eu/__init__.py | 65 --------- modules/account_stock_eu/tryton.cfg | 53 ++++++++ modules/account_stock_landed_cost/__init__.py | 25 ---- modules/account_stock_landed_cost/tryton.cfg | 19 +++ .../__init__.py | 10 -- .../tryton.cfg | 4 + .../account_stock_shipment_cost/__init__.py | 27 ---- .../account_stock_shipment_cost/tryton.cfg | 18 +++ .../__init__.py | 12 -- .../tryton.cfg | 5 +- modules/account_syscohada/__init__.py | 12 -- modules/account_syscohada/tryton.cfg | 4 + modules/account_tax_cash/__init__.py | 25 ---- modules/account_tax_cash/tryton.cfg | 13 ++ .../account_tax_non_deductible/__init__.py | 14 -- modules/account_tax_non_deductible/tryton.cfg | 6 + modules/account_tax_rule_country/__init__.py | 26 ---- modules/account_tax_rule_country/tryton.cfg | 20 +++ modules/analytic_account/__init__.py | 26 +--- modules/analytic_account/tryton.cfg | 13 ++ modules/analytic_budget/__init__.py | 16 --- modules/analytic_budget/tryton.cfg | 9 ++ modules/analytic_invoice/__init__.py | 23 ---- modules/analytic_invoice/tryton.cfg | 16 +++ modules/analytic_purchase/__init__.py | 11 -- modules/analytic_purchase/tryton.cfg | 5 + modules/analytic_sale/__init__.py | 11 -- modules/analytic_sale/tryton.cfg | 5 + modules/attendance/__init__.py | 19 --- modules/attendance/tryton.cfg | 12 ++ modules/authentication_saml/__init__.py | 6 +- modules/authentication_saml/tryton.cfg | 1 - modules/authentication_sms/__init__.py | 11 -- modules/authentication_sms/tryton.cfg | 5 + modules/bank/__init__.py | 17 --- modules/bank/tryton.cfg | 10 ++ modules/carrier/__init__.py | 14 -- modules/carrier/tryton.cfg | 7 + modules/carrier_carriage/__init__.py | 32 ----- modules/carrier_carriage/tryton.cfg | 24 ++++ modules/carrier_percentage/__init__.py | 19 --- modules/carrier_percentage/tryton.cfg | 13 ++ modules/carrier_subdivision/__init__.py | 20 --- modules/carrier_subdivision/tryton.cfg | 12 ++ modules/carrier_weight/__init__.py | 20 --- modules/carrier_weight/tryton.cfg | 14 ++ modules/commission/__init__.py | 56 -------- modules/commission/tryton.cfg | 39 ++++++ modules/commission_waiting/__init__.py | 14 -- modules/commission_waiting/tryton.cfg | 8 ++ modules/company/__init__.py | 44 +----- modules/company/tryton.cfg | 30 +++++ modules/company_work_time/__init__.py | 11 -- modules/company_work_time/tryton.cfg | 5 + modules/country/__init__.py | 15 --- modules/country/tryton.cfg | 9 ++ modules/currency/__init__.py | 14 -- modules/currency/tryton.cfg | 8 ++ modules/currency_ro/__init__.py | 12 -- modules/currency_ro/tryton.cfg | 4 + modules/currency_rs/__init__.py | 12 -- modules/currency_rs/tryton.cfg | 4 + modules/customs/__init__.py | 15 --- modules/customs/tryton.cfg | 9 ++ modules/dashboard/__init__.py | 12 -- modules/dashboard/tryton.cfg | 6 + modules/document_incoming/__init__.py | 21 +-- modules/document_incoming/tryton.cfg | 13 ++ modules/document_incoming_invoice/__init__.py | 14 -- modules/document_incoming_invoice/tryton.cfg | 6 + modules/document_incoming_ocr/__init__.py | 24 ---- modules/document_incoming_ocr/tryton.cfg | 14 ++ .../document_incoming_ocr_typless/__init__.py | 12 -- .../document_incoming_ocr_typless/tryton.cfg | 4 + modules/edocument_uncefact/__init__.py | 12 -- modules/edocument_uncefact/tryton.cfg | 5 +- modules/edocument_unece/__init__.py | 18 --- modules/edocument_unece/tryton.cfg | 7 + modules/google_maps/__init__.py | 10 -- modules/google_maps/tryton.cfg | 4 + modules/inbound_email/__init__.py | 15 +-- modules/inbound_email/tryton.cfg | 7 + modules/incoterm/__init__.py | 53 -------- modules/incoterm/tryton.cfg | 49 +++++++ modules/ldap_authentication/__init__.py | 10 -- modules/ldap_authentication/tryton.cfg | 4 + modules/marketing/__init__.py | 13 -- modules/marketing_automation/__init__.py | 31 +---- modules/marketing_automation/tryton.cfg | 21 +++ modules/marketing_campaign/__init__.py | 66 +-------- modules/marketing_campaign/tryton.cfg | 41 ++++++ modules/marketing_email/__init__.py | 24 +--- modules/marketing_email/tryton.cfg | 14 ++ modules/notification_email/__init__.py | 12 -- modules/notification_email/tryton.cfg | 7 + modules/party/__init__.py | 34 ----- modules/party/tryton.cfg | 26 ++++ modules/party_avatar/__init__.py | 17 --- modules/party_avatar/tryton.cfg | 10 ++ modules/party_relationship/__init__.py | 12 -- modules/party_relationship/tryton.cfg | 7 + modules/party_siret/__init__.py | 14 -- modules/party_siret/tryton.cfg | 9 ++ modules/product/__init__.py | 46 ++----- modules/product/tryton.cfg | 22 +++ modules/product_attribute/__init__.py | 14 -- modules/product_attribute/tryton.cfg | 8 ++ modules/product_classification/__init__.py | 13 -- modules/product_classification/tryton.cfg | 7 + .../__init__.py | 14 -- .../tryton.cfg | 8 ++ modules/product_cost_fifo/__init__.py | 11 -- modules/product_cost_fifo/tryton.cfg | 6 + modules/product_cost_history/__init__.py | 14 -- modules/product_cost_history/tryton.cfg | 6 + modules/product_cost_warehouse/__init__.py | 38 ------ modules/product_cost_warehouse/tryton.cfg | 27 ++++ modules/product_image/__init__.py | 22 +-- modules/product_image/tryton.cfg | 10 ++ modules/product_image_attribute/__init__.py | 13 -- modules/product_image_attribute/tryton.cfg | 5 + modules/product_kit/__init__.py | 54 -------- modules/product_kit/tryton.cfg | 51 +++++++ modules/product_measurements/__init__.py | 11 -- modules/product_measurements/tryton.cfg | 5 + modules/product_price_list/__init__.py | 17 +-- modules/product_price_list/tryton.cfg | 6 + modules/product_price_list_cache/__init__.py | 15 --- modules/product_price_list_cache/tryton.cfg | 7 + modules/product_price_list_dates/__init__.py | 27 ---- modules/product_price_list_dates/tryton.cfg | 19 +++ modules/product_price_list_parent/__init__.py | 13 -- modules/product_price_list_parent/tryton.cfg | 5 + modules/production/__init__.py | 33 ----- modules/production/tryton.cfg | 27 ++++ modules/production_outsourcing/__init__.py | 18 --- modules/production_outsourcing/tryton.cfg | 6 + modules/production_routing/__init__.py | 16 --- modules/production_routing/tryton.cfg | 10 ++ modules/production_split/__init__.py | 14 -- modules/production_split/tryton.cfg | 7 + modules/production_work/__init__.py | 16 --- modules/production_work/tryton.cfg | 10 ++ modules/production_work_timesheet/__init__.py | 12 -- modules/production_work_timesheet/tryton.cfg | 6 + modules/project/__init__.py | 19 --- modules/project/tryton.cfg | 12 ++ modules/project_invoice/__init__.py | 16 --- modules/project_invoice/tryton.cfg | 9 ++ modules/project_plan/__init__.py | 15 --- modules/project_plan/tryton.cfg | 8 ++ modules/project_revenue/__init__.py | 14 -- modules/project_revenue/tryton.cfg | 8 ++ modules/purchase/__init__.py | 56 -------- modules/purchase/tryton.cfg | 46 +++++++ modules/purchase_amendment/__init__.py | 14 -- modules/purchase_amendment/tryton.cfg | 6 + .../purchase_blanket_agreement/__init__.py | 21 --- modules/purchase_blanket_agreement/tryton.cfg | 12 ++ modules/purchase_history/__init__.py | 14 -- modules/purchase_history/tryton.cfg | 6 + .../__init__.py | 16 --- .../tryton.cfg | 9 ++ modules/purchase_price_list/__init__.py | 17 --- modules/purchase_price_list/tryton.cfg | 9 ++ modules/purchase_product_quantity/__init__.py | 15 --- modules/purchase_product_quantity/tryton.cfg | 6 + modules/purchase_request/__init__.py | 19 --- modules/purchase_request/tryton.cfg | 12 ++ .../purchase_request_quotation/__init__.py | 29 +--- modules/purchase_request_quotation/tryton.cfg | 15 +++ modules/purchase_requisition/__init__.py | 19 --- modules/purchase_requisition/tryton.cfg | 12 ++ modules/purchase_secondary_unit/__init__.py | 30 ----- modules/purchase_secondary_unit/tryton.cfg | 22 +++ modules/purchase_shipment_cost/__init__.py | 12 -- modules/purchase_shipment_cost/tryton.cfg | 6 + modules/quality/__init__.py | 34 +---- modules/quality/tryton.cfg | 23 ++++ modules/sale/__init__.py | 72 ---------- modules/sale/tryton.cfg | 63 +++++++++ modules/sale_advance_payment/__init__.py | 23 ---- modules/sale_advance_payment/tryton.cfg | 16 +++ modules/sale_amendment/__init__.py | 14 -- modules/sale_amendment/tryton.cfg | 6 + modules/sale_blanket_agreement/__init__.py | 21 --- modules/sale_blanket_agreement/tryton.cfg | 12 ++ modules/sale_complaint/__init__.py | 23 ---- modules/sale_complaint/tryton.cfg | 17 +++ modules/sale_credit_limit/__init__.py | 12 -- modules/sale_credit_limit/tryton.cfg | 6 + modules/sale_discount/__init__.py | 16 --- modules/sale_discount/tryton.cfg | 4 + modules/sale_extra/__init__.py | 13 -- modules/sale_extra/tryton.cfg | 7 + modules/sale_gift_card/__init__.py | 39 ------ modules/sale_gift_card/tryton.cfg | 28 ++++ modules/sale_history/__init__.py | 19 --- modules/sale_history/tryton.cfg | 11 ++ modules/sale_invoice_date/__init__.py | 18 --- modules/sale_invoice_date/tryton.cfg | 10 ++ modules/sale_invoice_grouping/__init__.py | 14 -- modules/sale_invoice_grouping/tryton.cfg | 8 ++ modules/sale_opportunity/__init__.py | 24 ---- modules/sale_opportunity/tryton.cfg | 17 +++ modules/sale_payment/__init__.py | 12 -- modules/sale_payment/tryton.cfg | 7 + modules/sale_point/__init__.py | 29 ---- modules/sale_point/tryton.cfg | 23 ++++ modules/sale_price_list/__init__.py | 21 --- modules/sale_price_list/tryton.cfg | 14 ++ modules/sale_product_customer/__init__.py | 30 ----- modules/sale_product_customer/tryton.cfg | 18 +++ modules/sale_product_quantity/__init__.py | 17 --- modules/sale_product_quantity/tryton.cfg | 10 ++ .../sale_product_recommendation/__init__.py | 20 --- .../sale_product_recommendation/tryton.cfg | 12 ++ .../__init__.py | 21 --- .../tryton.cfg | 13 ++ modules/sale_promotion/__init__.py | 15 --- modules/sale_promotion/tryton.cfg | 9 ++ modules/sale_promotion_coupon/__init__.py | 20 --- modules/sale_promotion_coupon/tryton.cfg | 8 ++ .../sale_promotion_coupon_payment/__init__.py | 12 -- .../sale_promotion_coupon_payment/tryton.cfg | 5 +- modules/sale_secondary_unit/__init__.py | 34 ----- modules/sale_secondary_unit/tryton.cfg | 26 ++++ modules/sale_shipment_cost/__init__.py | 31 +---- modules/sale_shipment_cost/tryton.cfg | 18 +++ modules/sale_shipment_grouping/__init__.py | 14 -- modules/sale_shipment_grouping/tryton.cfg | 8 ++ modules/sale_shipment_tolerance/__init__.py | 15 --- modules/sale_shipment_tolerance/tryton.cfg | 7 + modules/sale_stock_quantity/__init__.py | 11 -- modules/sale_stock_quantity/tryton.cfg | 5 + modules/sale_subscription/__init__.py | 35 ----- modules/sale_subscription/tryton.cfg | 24 ++++ modules/sale_subscription_asset/__init__.py | 16 --- modules/sale_subscription_asset/tryton.cfg | 8 ++ modules/sale_supply/__init__.py | 18 --- modules/sale_supply/tryton.cfg | 13 ++ modules/sale_supply_drop_shipment/__init__.py | 43 ------ modules/sale_supply_drop_shipment/tryton.cfg | 34 +++++ modules/sale_supply_production/__init__.py | 24 ---- modules/sale_supply_production/tryton.cfg | 12 ++ modules/stock/__init__.py | 79 +---------- modules/stock/tryton.cfg | 63 +++++++++ modules/stock_assign_manual/__init__.py | 24 ---- modules/stock_assign_manual/tryton.cfg | 16 +++ modules/stock_consignment/__init__.py | 21 --- modules/stock_consignment/tryton.cfg | 13 ++ modules/stock_forecast/__init__.py | 16 --- modules/stock_forecast/tryton.cfg | 9 ++ modules/stock_inventory_location/__init__.py | 13 -- modules/stock_inventory_location/tryton.cfg | 6 + modules/stock_location_move/__init__.py | 23 ---- modules/stock_location_move/tryton.cfg | 13 ++ modules/stock_location_sequence/__init__.py | 10 -- modules/stock_location_sequence/tryton.cfg | 4 + modules/stock_lot/__init__.py | 45 +------ modules/stock_lot/tryton.cfg | 32 +++++ modules/stock_lot_sled/__init__.py | 23 +--- modules/stock_lot_sled/tryton.cfg | 11 ++ modules/stock_lot_unit/__init__.py | 32 +---- modules/stock_lot_unit/tryton.cfg | 19 +++ modules/stock_package/__init__.py | 17 --- modules/stock_package/tryton.cfg | 11 ++ modules/stock_package_shipping/__init__.py | 21 --- modules/stock_package_shipping/tryton.cfg | 13 ++ .../stock_package_shipping_dpd/__init__.py | 20 --- modules/stock_package_shipping_dpd/tryton.cfg | 12 ++ .../stock_package_shipping_mygls/__init__.py | 22 --- .../stock_package_shipping_mygls/tryton.cfg | 12 ++ .../__init__.py | 24 ---- .../tryton.cfg | 14 ++ .../stock_package_shipping_ups/__init__.py | 21 --- modules/stock_package_shipping_ups/tryton.cfg | 13 ++ modules/stock_product_location/__init__.py | 19 --- modules/stock_product_location/tryton.cfg | 13 ++ .../stock_product_location_place/__init__.py | 21 --- .../stock_product_location_place/tryton.cfg | 13 ++ .../stock_quantity_early_planning/__init__.py | 21 --- .../stock_quantity_early_planning/tryton.cfg | 12 ++ modules/stock_quantity_issue/__init__.py | 21 --- modules/stock_quantity_issue/tryton.cfg | 13 ++ modules/stock_secondary_unit/__init__.py | 16 --- modules/stock_secondary_unit/tryton.cfg | 8 ++ modules/stock_shipment_cost/__init__.py | 28 +--- modules/stock_shipment_cost/tryton.cfg | 11 ++ .../stock_shipment_cost_weight/__init__.py | 14 -- modules/stock_shipment_cost_weight/tryton.cfg | 6 + .../stock_shipment_measurements/__init__.py | 29 ---- .../stock_shipment_measurements/tryton.cfg | 17 +++ modules/stock_split/__init__.py | 19 --- modules/stock_split/tryton.cfg | 12 ++ modules/stock_supply/__init__.py | 24 ---- modules/stock_supply/tryton.cfg | 16 +++ modules/stock_supply_day/__init__.py | 11 -- modules/stock_supply_day/tryton.cfg | 5 + modules/stock_supply_forecast/__init__.py | 10 -- modules/stock_supply_forecast/tryton.cfg | 4 + modules/stock_supply_production/__init__.py | 18 --- modules/stock_supply_production/tryton.cfg | 11 ++ modules/timesheet/__init__.py | 23 +--- modules/timesheet/tryton.cfg | 15 +++ modules/timesheet_cost/__init__.py | 12 -- modules/timesheet_cost/tryton.cfg | 6 + modules/user_role/__init__.py | 20 --- modules/user_role/tryton.cfg | 8 ++ modules/web_shop/__init__.py | 35 ----- modules/web_shop/tryton.cfg | 31 +++++ .../web_shop_product_data_feed/__init__.py | 34 +---- modules/web_shop_product_data_feed/tryton.cfg | 26 ++++ modules/web_shop_shopify/__init__.py | 67 +--------- modules/web_shop_shopify/tryton.cfg | 60 +++++++++ modules/web_shop_vue_storefront/__init__.py | 42 +----- modules/web_shop_vue_storefront/tryton.cfg | 34 +++++ .../__init__.py | 12 -- .../web_shop_vue_storefront_stripe/tryton.cfg | 4 + modules/web_shortener/__init__.py | 17 +-- modules/web_shortener/tryton.cfg | 5 + modules/web_user/__init__.py | 23 ---- modules/web_user/tryton.cfg | 15 +++ trytond/CHANGELOG | 1 + trytond/doc/ref/pool.rst | 1 - trytond/doc/topics/modules/index.rst | 45 +++++-- trytond/doc/tutorial/module/extend.rst | 17 ++- trytond/doc/tutorial/module/model.rst | 30 +++-- trytond/doc/tutorial/module/report.rst | 15 ++- trytond/doc/tutorial/module/table_query.rst | 16 +-- trytond/doc/tutorial/module/wizard.rst | 15 ++- trytond/trytond/i18n.py | 5 +- trytond/trytond/ir/__init__.py | 117 +--------------- trytond/trytond/ir/tryton.cfg | 106 +++++++++++++++ trytond/trytond/modules/__init__.py | 72 ++++++++-- trytond/trytond/pool.py | 41 +++++- trytond/trytond/res/__init__.py | 26 +--- trytond/trytond/res/tryton.cfg | 17 +++ 433 files changed, 3421 insertions(+), 4814 deletions(-) diff --git a/cookiecutter-module/{{ cookiecutter.module_name }}/__init__.py b/cookiecutter-module/{{ cookiecutter.module_name }}/__init__.py index 2151c398fa..36a06d676b 100644 --- a/cookiecutter-module/{{ cookiecutter.module_name }}/__init__.py +++ b/cookiecutter-module/{{ cookiecutter.module_name }}/__init__.py @@ -1,17 +1,4 @@ {% if not cookiecutter.prefix -%} # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - {% endif -%} -from trytond.pool import Pool - -__all__ = ['register'] - - -def register(): - Pool.register( - module='{{ cookiecutter.module_name }}', type_='model') - Pool.register( - module='{{ cookiecutter.module_name }}', type_='wizard') - Pool.register( - module='{{ cookiecutter.module_name }}', type_='report') diff --git a/cookiecutter-module/{{ cookiecutter.module_name }}/tryton.cfg b/cookiecutter-module/{{ cookiecutter.module_name }}/tryton.cfg index 43a8cca190..d12167cb5f 100644 --- a/cookiecutter-module/{{ cookiecutter.module_name }}/tryton.cfg +++ b/cookiecutter-module/{{ cookiecutter.module_name }}/tryton.cfg @@ -3,3 +3,10 @@ version={{ cookiecutter.version }} depends: ir xml: + +[register] +model: + +wizard: + +report: diff --git a/modules/account/__init__.py b/modules/account/__init__.py index 2a783d0b8c..433825ff0b 100644 --- a/modules/account/__init__.py +++ b/modules/account/__init__.py @@ -1,124 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import ( - account, company, configuration, fiscalyear, journal, move, move_template, - party, period, tax) -from .move import MoveLineMixin - -__all__ = ['register', 'MoveLineMixin'] +__all__ = ['MoveLineMixin'] -def register(): - Pool.register( - fiscalyear.FiscalYear, - fiscalyear.BalanceNonDeferralStart, - company.Company, - account.TypeTemplate, - account.Type, - account.AccountTemplate, - account.AccountTemplateTaxTemplate, - account.Account, - account.AccountParty, - account.AccountDeferral, - account.AccountTax, - account.AccountContext, - account.GeneralLedgerAccount, - account.GeneralLedgerAccountContext, - account.GeneralLedgerAccountParty, - account.GeneralLedgerLine, - account.GeneralLedgerLineContext, - account.BalanceSheetContext, - account.BalanceSheetComparisionContext, - account.IncomeStatementContext, - account.CreateChartStart, - account.CreateChartAccount, - account.CreateChartProperties, - account.UpdateChartStart, - account.UpdateChartSucceed, - account.AgedBalanceContext, - account.AgedBalance, - configuration.Configuration, - configuration.ConfigurationDefaultAccount, - configuration.DefaultTaxRule, - configuration.Sequence, - configuration.Journal, - period.Period, - journal.Journal, - journal.JournalCashContext, - journal.JournalPeriod, - move.Move, - move.MoveContext, - move.Reconciliation, - configuration.ConfigurationTaxRounding, - move.Line, - move.LineReceivablePayableContext, - move.WriteOff, - move.OpenJournalAsk, - move.ReconcileLinesWriteOff, - move.ReconcileStart, - move.ReconcileShow, - move.CancelMovesDefault, - move.GroupLinesStart, - move.RescheduleLinesStart, - move.RescheduleLinesPreview, - move.RescheduleLinesTerm, - move.DelegateLinesStart, - tax.TaxGroup, - tax.TaxCodeTemplate, - tax.TaxCode, - tax.TaxCodeLineTemplate, - tax.TaxCodeLine, - tax.TaxCodeContext, - tax.TaxTemplate, - tax.Tax, - tax.TaxLine, - tax.TaxRuleTemplate, - tax.TaxRule, - tax.TaxRuleLineTemplate, - tax.TaxRuleLine, - tax.TestTaxView, - tax.TestTaxViewResult, - move_template.MoveTemplate, - move_template.MoveTemplateKeyword, - move_template.MoveLineTemplate, - move_template.TaxLineTemplate, - move_template.CreateMoveTemplate, - move_template.CreateMoveKeywords, - party.Party, - party.PartyAccount, - fiscalyear.CreatePeriodsStart, - fiscalyear.RenewFiscalYearStart, - module='account', type_='model') - Pool.register( - account.OpenType, - fiscalyear.BalanceNonDeferral, - account.CreateChart, - account.UpdateChart, - account.OpenGeneralLedgerAccountParty, - move.OpenJournal, - move.OpenAccount, - move.ReconcileLines, - move.UnreconcileLines, - move.Reconcile, - move.CancelMoves, - move.GroupLines, - move.RescheduleLines, - move.DelegateLines, - move_template.CreateMove, - tax.OpenTaxCode, - tax.TestTax, - party.PartyReplace, - party.PartyErase, - fiscalyear.CreatePeriods, - fiscalyear.RenewFiscalYear, - module='account', type_='wizard') - Pool.register( - account.AccountTypeStatement, - account.GeneralLedger, - account.TrialBalance, - account.AgedBalanceReport, - move.GeneralJournal, - module='account', type_='report') +def __getattr__(name): + if name == 'MoveLineMixin': + from .move import MoveLineMixin + return MoveLineMixin + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/account/tryton.cfg b/modules/account/tryton.cfg index 9d6f926103..ead5bc2ebb 100644 --- a/modules/account/tryton.cfg +++ b/modules/account/tryton.cfg @@ -22,3 +22,112 @@ xml: account_chart_es.xml account_chart_fr.xml message.xml + +[register] +model: + fiscalyear.FiscalYear + fiscalyear.BalanceNonDeferralStart + company.Company + account.TypeTemplate + account.Type + account.AccountTemplate + account.AccountTemplateTaxTemplate + account.Account + account.AccountParty + account.AccountDeferral + account.AccountTax + account.AccountContext + account.GeneralLedgerAccount + account.GeneralLedgerAccountContext + account.GeneralLedgerAccountParty + account.GeneralLedgerLine + account.GeneralLedgerLineContext + account.BalanceSheetContext + account.BalanceSheetComparisionContext + account.IncomeStatementContext + account.CreateChartStart + account.CreateChartAccount + account.CreateChartProperties + account.UpdateChartStart + account.UpdateChartSucceed + account.AgedBalanceContext + account.AgedBalance + configuration.Configuration + configuration.ConfigurationDefaultAccount + configuration.DefaultTaxRule + configuration.Sequence + configuration.Journal + period.Period + journal.Journal + journal.JournalCashContext + journal.JournalPeriod + move.Move + move.MoveContext + move.Reconciliation + configuration.ConfigurationTaxRounding + move.Line + move.LineReceivablePayableContext + move.WriteOff + move.OpenJournalAsk + move.ReconcileLinesWriteOff + move.ReconcileStart + move.ReconcileShow + move.CancelMovesDefault + move.GroupLinesStart + move.RescheduleLinesStart + move.RescheduleLinesPreview + move.RescheduleLinesTerm + move.DelegateLinesStart + tax.TaxGroup + tax.TaxCodeTemplate + tax.TaxCode + tax.TaxCodeLineTemplate + tax.TaxCodeLine + tax.TaxCodeContext + tax.TaxTemplate + tax.Tax + tax.TaxLine + tax.TaxRuleTemplate + tax.TaxRule + tax.TaxRuleLineTemplate + tax.TaxRuleLine + tax.TestTaxView + tax.TestTaxViewResult + move_template.MoveTemplate + move_template.MoveTemplateKeyword + move_template.MoveLineTemplate + move_template.TaxLineTemplate + move_template.CreateMoveTemplate + move_template.CreateMoveKeywords + party.Party + party.PartyAccount + fiscalyear.CreatePeriodsStart + fiscalyear.RenewFiscalYearStart +wizard: + account.OpenType + fiscalyear.BalanceNonDeferral + account.CreateChart + account.UpdateChart + account.OpenGeneralLedgerAccountParty + move.OpenJournal + move.OpenAccount + move.ReconcileLines + move.UnreconcileLines + move.Reconcile + move.CancelMoves + move.GroupLines + move.RescheduleLines + move.DelegateLines + move_template.CreateMove + tax.OpenTaxCode + tax.TestTax + party.PartyReplace + party.PartyErase + fiscalyear.CreatePeriods + fiscalyear.RenewFiscalYear +report: + account.AccountTypeStatement + account.GeneralLedger + account.TrialBalance + account.AgedBalanceReport + move.GeneralJournal diff --git a/modules/account_asset/__init__.py b/modules/account_asset/__init__.py index 8820932def..dfd7bb0c61 100644 --- a/modules/account_asset/__init__.py +++ b/modules/account_asset/__init__.py @@ -1,42 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of this # repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import account, asset, invoice, product, purchase - - -def register(): - Pool.register( - asset.Asset, - asset.AssetLine, - asset.AssetUpdateMove, - asset.CreateMovesStart, - asset.AssetRevision, - asset.UpdateAssetShowDepreciation, - asset.PrintDepreciationTableStart, - product.Category, - product.CategoryAccount, - product.Template, - product.Product, - invoice.InvoiceLine, - account.Configuration, - account.ConfigurationAssetSequence, - account.ConfigurationAssetDate, - account.ConfigurationAssetFrequency, - account.AccountTypeTemplate, - account.AccountType, - account.Move, - account.Period, - account.Journal, - module='account_asset', type_='model') - Pool.register( - purchase.Line, - module='account_asset', type_='model', depends=['purchase']) - Pool.register( - asset.CreateMoves, - asset.UpdateAsset, - asset.PrintDepreciationTable, - module='account_asset', type_='wizard') - Pool.register( - asset.AssetDepreciationTable, - module='account_asset', type_='report') diff --git a/modules/account_asset/tryton.cfg b/modules/account_asset/tryton.cfg index 7d949d3f00..77af777f70 100644 --- a/modules/account_asset/tryton.cfg +++ b/modules/account_asset/tryton.cfg @@ -19,3 +19,37 @@ xml: account_chart_es.xml account_chart_fr.xml message.xml + +[register] +model: + asset.Asset + asset.AssetLine + asset.AssetUpdateMove + asset.CreateMovesStart + asset.AssetRevision + asset.UpdateAssetShowDepreciation + asset.PrintDepreciationTableStart + product.Category + product.CategoryAccount + product.Template + product.Product + invoice.InvoiceLine + account.Configuration + account.ConfigurationAssetSequence + account.ConfigurationAssetDate + account.ConfigurationAssetFrequency + account.AccountTypeTemplate + account.AccountType + account.Move + account.Period + account.Journal +wizard: + asset.CreateMoves + asset.UpdateAsset + asset.PrintDepreciationTable +report: + asset.AssetDepreciationTable + +[register purchase] +model: + purchase.Line diff --git a/modules/account_be/__init__.py b/modules/account_be/__init__.py index 41de9915a6..4effdfa4a2 100644 --- a/modules/account_be/__init__.py +++ b/modules/account_be/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - - -def register(): - Pool.register( - account.BEVATCustomer, - account.BEVATCustomerContext, - module='account_be', type_='model') - Pool.register( - account.CreateChart, - module='account_be', type_='wizard') diff --git a/modules/account_be/tryton.cfg b/modules/account_be/tryton.cfg index 1166ab4cf6..3f6e848421 100644 --- a/modules/account_be/tryton.cfg +++ b/modules/account_be/tryton.cfg @@ -14,3 +14,10 @@ xml: tax_be_fr.xml account_be_nl.xml tax_be_nl.xml + +[register] +model: + account.BEVATCustomer + account.BEVATCustomerContext +wizard: + account.CreateChart diff --git a/modules/account_budget/__init__.py b/modules/account_budget/__init__.py index bfbb0b2905..dbf21923c6 100644 --- a/modules/account_budget/__init__.py +++ b/modules/account_budget/__init__.py @@ -1,28 +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. -from trytond.pool import Pool - -from . import account -from .account import ( - BudgetLineMixin, BudgetMixin, CopyBudgetMixin, CopyBudgetStartMixin) - __all__ = [ 'BudgetMixin', 'BudgetLineMixin', 'CopyBudgetMixin', 'CopyBudgetStartMixin', - 'register'] + ] -def register(): - Pool.register( - account.BudgetContext, - account.Budget, - account.BudgetLine, - account.BudgetLinePeriod, - account.CopyBudgetStart, - account.CreatePeriodsStart, - module='account_budget', type_='model') - Pool.register( - account.CopyBudget, - account.CreatePeriods, - module='account_budget', type_='wizard') +def __getattr__(name): + if name in __all__: + from . import account + return getattr(account, name) + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/account_budget/tryton.cfg b/modules/account_budget/tryton.cfg index 19fec924f1..8186357e8d 100644 --- a/modules/account_budget/tryton.cfg +++ b/modules/account_budget/tryton.cfg @@ -7,3 +7,15 @@ depends: xml: account.xml message.xml + +[register] +model: + account.BudgetContext + account.Budget + account.BudgetLine + account.BudgetLinePeriod + account.CopyBudgetStart + account.CreatePeriodsStart +wizard: + account.CopyBudget + account.CreatePeriods diff --git a/modules/account_cash_rounding/__init__.py b/modules/account_cash_rounding/__init__.py index ee5329741f..4effdfa4a2 100644 --- a/modules/account_cash_rounding/__init__.py +++ b/modules/account_cash_rounding/__init__.py @@ -1,27 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import account, currency, purchase, sale - -__all__ = ['register'] - - -def register(): - Pool.register( - account.Configuration, - account.ConfigurationCashRoundingAccount, - currency.Currency, - module='account_cash_rounding', type_='model') - Pool.register( - account.Invoice, - module='account_cash_rounding', type_='model', - depends=['account_invoice']) - Pool.register( - purchase.Purchase, - module='account_cash_rounding', type_='model', - depends=['purchase']) - Pool.register( - sale.Sale, - module='account_cash_rounding', type_='model', - depends=['sale']) diff --git a/modules/account_cash_rounding/tryton.cfg b/modules/account_cash_rounding/tryton.cfg index 4712ffb9b5..4d615596eb 100644 --- a/modules/account_cash_rounding/tryton.cfg +++ b/modules/account_cash_rounding/tryton.cfg @@ -13,3 +13,21 @@ xml: currency.xml purchase.xml message.xml + +[register] +model: + account.Configuration + account.ConfigurationCashRoundingAccount + currency.Currency + +[register account_invoice] +model: + account.Invoice + +[register purchase] +model: + purchase.Purchase + +[register sale] +model: + sale.Sale diff --git a/modules/account_consolidation/__init__.py b/modules/account_consolidation/__init__.py index 232e31cbe3..4effdfa4a2 100644 --- a/modules/account_consolidation/__init__.py +++ b/modules/account_consolidation/__init__.py @@ -1,24 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - - -def register(): - Pool.register( - account.Type, - account.Move, - account.MoveLine, - account.Consolidation, - account.ConsolidationBalanceSheetContext, - account.ConsolidationIncomeStatementContext, - module='account_consolidation', type_='model') - Pool.register( - account.ConsolidationStatement, - module='account_consolidation', type_='report') - Pool.register( - account.Invoice, - module='account_consolidation', type_='model', - depends=['account_invoice']) diff --git a/modules/account_consolidation/tryton.cfg b/modules/account_consolidation/tryton.cfg index 215dfbe96d..609c9a6105 100644 --- a/modules/account_consolidation/tryton.cfg +++ b/modules/account_consolidation/tryton.cfg @@ -9,3 +9,18 @@ extras_depend: account_invoice xml: account.xml + +[register] +model: + account.Type + account.Move + account.MoveLine + account.Consolidation + account.ConsolidationBalanceSheetContext + account.ConsolidationIncomeStatementContext +report: + account.ConsolidationStatement + +[register account_invoice] +model: + account.Invoice diff --git a/modules/account_credit_limit/__init__.py b/modules/account_credit_limit/__init__.py index d7fe0f4eb8..4effdfa4a2 100644 --- a/modules/account_credit_limit/__init__.py +++ b/modules/account_credit_limit/__init__.py @@ -1,19 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, party - - -def register(): - Pool.register( - account.Configuration, - account.ConfigurationDefaultCreditLimitAmount, - party.Party, - party.PartyCreditLimitAmount, - module='account_credit_limit', type_='model') - Pool.register( - account.Level, - module='account_credit_limit', type_='model', - depends=['account_dunning']) diff --git a/modules/account_credit_limit/tryton.cfg b/modules/account_credit_limit/tryton.cfg index d65ad59cdf..a79d4e07d5 100644 --- a/modules/account_credit_limit/tryton.cfg +++ b/modules/account_credit_limit/tryton.cfg @@ -12,3 +12,14 @@ xml: account.xml party.xml message.xml + +[register] +model: + account.Configuration + account.ConfigurationDefaultCreditLimitAmount + party.Party + party.PartyCreditLimitAmount + +[register account_dunning] +model: + account.Level diff --git a/modules/account_de_skr03/__init__.py b/modules/account_de_skr03/__init__.py index 3fa169cd68..eb77e5a73c 100644 --- a/modules/account_de_skr03/__init__.py +++ b/modules/account_de_skr03/__init__.py @@ -1,6 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - - -def register(): - pass diff --git a/modules/account_deposit/__init__.py b/modules/account_deposit/__init__.py index 85c78d9258..4effdfa4a2 100644 --- a/modules/account_deposit/__init__.py +++ b/modules/account_deposit/__init__.py @@ -1,26 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, invoice, party - - -def register(): - Pool.register( - account.AccountTypeTemplate, - account.AccountType, - invoice.Invoice, - invoice.InvoiceLine, - invoice.DepositRecallStart, - party.Party, - module='account_deposit', type_='model') - Pool.register( - account.Reconcile, - invoice.DepositRecall, - party.Erase, - module='account_deposit', type_='wizard') - Pool.register( - account.Payment, - module='account_deposit', type_='model', - depends=['account_payment_clearing']) diff --git a/modules/account_deposit/tryton.cfg b/modules/account_deposit/tryton.cfg index c07cb94f84..04db575bca 100644 --- a/modules/account_deposit/tryton.cfg +++ b/modules/account_deposit/tryton.cfg @@ -18,3 +18,20 @@ xml: account_chart_es.xml account_chart_fr.xml message.xml + +[register] +model: + account.AccountTypeTemplate + account.AccountType + invoice.Invoice + invoice.InvoiceLine + invoice.DepositRecallStart + party.Party +wizard: + account.Reconcile + invoice.DepositRecall + party.Erase + +[register account_payment_clearing] +model: + account.Payment diff --git a/modules/account_dunning/__init__.py b/modules/account_dunning/__init__.py index 30e49e5fea..4effdfa4a2 100644 --- a/modules/account_dunning/__init__.py +++ b/modules/account_dunning/__init__.py @@ -1,26 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, dunning, party - - -def register(): - Pool.register( - dunning.Procedure, - dunning.Level, - dunning.Dunning, - dunning.CreateDunningStart, - dunning.ProcessDunningStart, - party.Party, - party.PartyDunningProcedure, - account.Configuration, - account.ConfigurationDefaultDunningProcedure, - account.MoveLine, - module='account_dunning', type_='model') - Pool.register( - dunning.CreateDunning, - dunning.ProcessDunning, - dunning.RescheduleDunning, - module='account_dunning', type_='wizard') diff --git a/modules/account_dunning/tryton.cfg b/modules/account_dunning/tryton.cfg index 8ab44c0db6..596398b955 100644 --- a/modules/account_dunning/tryton.cfg +++ b/modules/account_dunning/tryton.cfg @@ -11,3 +11,20 @@ xml: party.xml account.xml message.xml + +[register] +model: + dunning.Procedure + dunning.Level + dunning.Dunning + dunning.CreateDunningStart + dunning.ProcessDunningStart + party.Party + party.PartyDunningProcedure + account.Configuration + account.ConfigurationDefaultDunningProcedure + account.MoveLine +wizard: + dunning.CreateDunning + dunning.ProcessDunning + dunning.RescheduleDunning diff --git a/modules/account_dunning_email/__init__.py b/modules/account_dunning_email/__init__.py index d7171d56c9..4effdfa4a2 100644 --- a/modules/account_dunning_email/__init__.py +++ b/modules/account_dunning_email/__init__.py @@ -1,22 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, ir - -__all__ = ['register'] - - -def register(): - Pool.register( - ir.Email, - account.Configuration, - account.DunningLevel, - account.Dunning, - module='account_dunning_email', type_='model') - Pool.register( - account.ProcessDunning, - module='account_dunning_email', type_='wizard') - Pool.register( - module='account_dunning_email', type_='report') diff --git a/modules/account_dunning_email/tryton.cfg b/modules/account_dunning_email/tryton.cfg index 9b763eab11..497b8dc01a 100644 --- a/modules/account_dunning_email/tryton.cfg +++ b/modules/account_dunning_email/tryton.cfg @@ -8,3 +8,12 @@ depends: party xml: account.xml + +[register] +model: + ir.Email + account.Configuration + account.DunningLevel + account.Dunning +wizard: + account.ProcessDunning diff --git a/modules/account_dunning_fee/__init__.py b/modules/account_dunning_fee/__init__.py index 4887bae595..4effdfa4a2 100644 --- a/modules/account_dunning_fee/__init__.py +++ b/modules/account_dunning_fee/__init__.py @@ -1,20 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, dunning - - -def register(): - Pool.register( - dunning.Fee, - dunning.Level, - dunning.Dunning, - dunning.FeeDunningLevel, - account.Move, - module='account_dunning_fee', type_='model') - Pool.register( - dunning.Letter, - module='account_dunning_fee', type_='report', - depends=['account_dunning_letter']) diff --git a/modules/account_dunning_fee/tryton.cfg b/modules/account_dunning_fee/tryton.cfg index a47e02fe62..46e54a821f 100644 --- a/modules/account_dunning_fee/tryton.cfg +++ b/modules/account_dunning_fee/tryton.cfg @@ -9,3 +9,15 @@ extras_depend: xml: dunning.xml message.xml + +[register] +model: + dunning.Fee + dunning.Level + dunning.Dunning + dunning.FeeDunningLevel + account.Move + +[register account_dunning_letter] +report: + dunning.Letter diff --git a/modules/account_dunning_letter/__init__.py b/modules/account_dunning_letter/__init__.py index 9ea82e92a3..4effdfa4a2 100644 --- a/modules/account_dunning_letter/__init__.py +++ b/modules/account_dunning_letter/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import dunning - - -def register(): - Pool.register( - dunning.Level, - module='account_dunning_letter', type_='model') - Pool.register( - dunning.ProcessDunning, - module='account_dunning_letter', type_='wizard') - Pool.register( - dunning.Letter, - module='account_dunning_letter', type_='report') diff --git a/modules/account_dunning_letter/tryton.cfg b/modules/account_dunning_letter/tryton.cfg index a865f3346c..6054026cdd 100644 --- a/modules/account_dunning_letter/tryton.cfg +++ b/modules/account_dunning_letter/tryton.cfg @@ -8,3 +8,11 @@ depends: party xml: dunning.xml + +[register] +model: + dunning.Level +wizard: + dunning.ProcessDunning +report: + dunning.Letter diff --git a/modules/account_es/__init__.py b/modules/account_es/__init__.py index fde1c43984..4effdfa4a2 100644 --- a/modules/account_es/__init__.py +++ b/modules/account_es/__init__.py @@ -1,41 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import account, account_payment, company, party, reporting_tax - - -def register(): - Pool.register( - reporting_tax.PrintAEATStart, - account.TaxCodeTemplate, - account.TaxCode, - account.TaxTemplate, - account.Tax, - account.Invoice, - company.Company, - party.Party, - party.Identifier, - reporting_tax.ESVATList, - reporting_tax.ESVATListContext, - reporting_tax.ECOperationList, - reporting_tax.ECOperationListContext, - reporting_tax.ESVATBook, - reporting_tax.ESVATBookContext, - module='account_es', type_='model') - Pool.register( - reporting_tax.AEAT111, - reporting_tax.AEAT115, - reporting_tax.AEAT303, - reporting_tax.AEAT347, - reporting_tax.AEAT349, - reporting_tax.VATBookReport, - module='account_es', type_='report') - Pool.register( - account.CreateChart, - reporting_tax.PrintAEAT, - module='account_es', type_='wizard') - Pool.register( - account_payment.Journal, - account_payment.Group, - module='account_es', type_='model', depends=['account_payment_sepa']) diff --git a/modules/account_es/tryton.cfg b/modules/account_es/tryton.cfg index f887c37c20..977152d3bb 100644 --- a/modules/account_es/tryton.cfg +++ b/modules/account_es/tryton.cfg @@ -24,3 +24,36 @@ xml: message.xml party.xml account_payment.xml + +[register] +model: + reporting_tax.PrintAEATStart + account.TaxCodeTemplate + account.TaxCode + account.TaxTemplate + account.Tax + account.Invoice + company.Company + party.Party + party.Identifier + reporting_tax.ESVATList + reporting_tax.ESVATListContext + reporting_tax.ECOperationList + reporting_tax.ECOperationListContext + reporting_tax.ESVATBook + reporting_tax.ESVATBookContext +wizard: + account.CreateChart + reporting_tax.PrintAEAT +report: + reporting_tax.AEAT111 + reporting_tax.AEAT115 + reporting_tax.AEAT303 + reporting_tax.AEAT347 + reporting_tax.AEAT349 + reporting_tax.VATBookReport + +[register account_payment_sepa] +model: + account_payment.Journal + account_payment.Group diff --git a/modules/account_es_sii/__init__.py b/modules/account_es_sii/__init__.py index 19cdfd3753..eb77e5a73c 100644 --- a/modules/account_es_sii/__init__.py +++ b/modules/account_es_sii/__init__.py @@ -1,25 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import account, ir, party - -__all__ = ['register'] - - -def register(): - Pool.register( - ir.Cron, - account.Configuration, - account.CredentialSII, - account.TaxTemplate, - account.Tax, - account.FiscalYear, - account.Period, - account.Invoice, - account.InvoiceSII, - party.Identifier, - module='account_es_sii', type_='model') - Pool.register( - account.RenewFiscalYear, - module='account_es_sii', type_='wizard') diff --git a/modules/account_es_sii/tryton.cfg b/modules/account_es_sii/tryton.cfg index e16af3d83c..ef57e92220 100644 --- a/modules/account_es_sii/tryton.cfg +++ b/modules/account_es_sii/tryton.cfg @@ -9,3 +9,18 @@ xml: account.xml message.xml tax.xml + +[register] +model: + ir.Cron + account.Configuration + account.CredentialSII + account.TaxTemplate + account.Tax + account.FiscalYear + account.Period + account.Invoice + account.InvoiceSII + party.Identifier +wizard: + account.RenewFiscalYear diff --git a/modules/account_eu/__init__.py b/modules/account_eu/__init__.py index 5629b445ef..4effdfa4a2 100644 --- a/modules/account_eu/__init__.py +++ b/modules/account_eu/__init__.py @@ -1,17 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.TaxTemplate, - account.Tax, - account.ECSalesList, - account.ECSalesListContext, - module='account_eu', type_='model') diff --git a/modules/account_eu/tryton.cfg b/modules/account_eu/tryton.cfg index 3d70c8ea81..6a0ef08e20 100644 --- a/modules/account_eu/tryton.cfg +++ b/modules/account_eu/tryton.cfg @@ -9,3 +9,10 @@ depends: party xml: account.xml + +[register] +model: + account.TaxTemplate + account.Tax + account.ECSalesList + account.ECSalesListContext diff --git a/modules/account_export/__init__.py b/modules/account_export/__init__.py index 33a4942177..4effdfa4a2 100644 --- a/modules/account_export/__init__.py +++ b/modules/account_export/__init__.py @@ -1,17 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.Configuration, - account.ConfigurationExport, - account.Move, - account.MoveExport, - module='account_export', type_='model') diff --git a/modules/account_export/tryton.cfg b/modules/account_export/tryton.cfg index 1d5472e0e9..f1ee3f96de 100644 --- a/modules/account_export/tryton.cfg +++ b/modules/account_export/tryton.cfg @@ -7,3 +7,10 @@ depends: xml: account.xml message.xml + +[register] +model: + account.Configuration + account.ConfigurationExport + account.Move + account.MoveExport diff --git a/modules/account_export_winbooks/__init__.py b/modules/account_export_winbooks/__init__.py index 5d545f6719..4effdfa4a2 100644 --- a/modules/account_export_winbooks/__init__.py +++ b/modules/account_export_winbooks/__init__.py @@ -1,29 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, party - -__all__ = ['register'] - - -def register(): - Pool.register( - party.Configuration, - party.Party, - party.Identifier, - account.Account, - account.FiscalYear, - account.Period, - account.Journal, - account.Move, - account.MoveLine, - account.TaxTemplate, - account.Tax, - account.TaxLine, - account.MoveExport, - module='account_export_winbooks', type_='model') - Pool.register( - account.RenewFiscalYear, - module='account_export_winbooks', type_='wizard') diff --git a/modules/account_export_winbooks/tryton.cfg b/modules/account_export_winbooks/tryton.cfg index 32fdda2541..a478d96899 100644 --- a/modules/account_export_winbooks/tryton.cfg +++ b/modules/account_export_winbooks/tryton.cfg @@ -15,3 +15,21 @@ xml: account_be_nl.xml party.xml message.xml + +[register] +model: + party.Configuration + party.Party + party.Identifier + account.Account + account.FiscalYear + account.Period + account.Journal + account.Move + account.MoveLine + account.TaxTemplate + account.Tax + account.TaxLine + account.MoveExport +wizard: + account.RenewFiscalYear diff --git a/modules/account_fr/__init__.py b/modules/account_fr/__init__.py index 0e6bff07fd..4effdfa4a2 100644 --- a/modules/account_fr/__init__.py +++ b/modules/account_fr/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - - -def register(): - Pool.register( - account.AccountTemplate, - account.FrFECStart, - account.FrFECResult, - module='account_fr', type_='model') - Pool.register( - account.CreateChart, - account.FrFEC, - module='account_fr', type_='wizard') diff --git a/modules/account_fr/tryton.cfg b/modules/account_fr/tryton.cfg index ae4a37b930..3a9f1765de 100644 --- a/modules/account_fr/tryton.cfg +++ b/modules/account_fr/tryton.cfg @@ -12,3 +12,12 @@ xml: account.xml account_fr.xml tax_fr.xml + +[register] +model: + account.AccountTemplate + account.FrFECStart + account.FrFECResult +wizard: + account.CreateChart + account.FrFEC diff --git a/modules/account_fr_chorus/__init__.py b/modules/account_fr_chorus/__init__.py index 78cc886d51..4effdfa4a2 100644 --- a/modules/account_fr_chorus/__init__.py +++ b/modules/account_fr_chorus/__init__.py @@ -1,27 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, edocument, ir, party - -__all__ = ['register'] - - -def register(): - Pool.register( - account.Configuration, - account.CredentialChorus, - account.Invoice, - account.InvoiceChorus, - party.Party, - ir.Cron, - module='account_fr_chorus', type_='model') - Pool.register( - edocument.UNCEFACTInvoice, - module='account_fr_chorus', type_='model', - depends=['edocument_uncefact']) - Pool.register( - module='account_fr_chorus', type_='wizard') - Pool.register( - module='account_fr_chorus', type_='report') diff --git a/modules/account_fr_chorus/tryton.cfg b/modules/account_fr_chorus/tryton.cfg index e17d81782f..7d564b87d9 100644 --- a/modules/account_fr_chorus/tryton.cfg +++ b/modules/account_fr_chorus/tryton.cfg @@ -13,3 +13,16 @@ xml: account.xml party.xml message.xml + +[register] +model: + account.Configuration + account.CredentialChorus + account.Invoice + account.InvoiceChorus + party.Party + ir.Cron + +[register edocument_uncefact] +model: + edocument.UNCEFACTInvoice diff --git a/modules/account_invoice/__init__.py b/modules/account_invoice/__init__.py index 3ef8607f94..4effdfa4a2 100644 --- a/modules/account_invoice/__init__.py +++ b/modules/account_invoice/__init__.py @@ -1,60 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, company, invoice, party, payment_term - - -def register(): - Pool.register( - payment_term.PaymentTerm, - payment_term.PaymentTermLine, - payment_term.PaymentTermLineRelativeDelta, - payment_term.TestPaymentTermView, - payment_term.TestPaymentTermViewResult, - invoice.Invoice, - invoice.InvoiceAdditionalMove, - invoice.AlternativePayee, - invoice.InvoicePaymentLine, - invoice.InvoiceLine, - invoice.InvoiceLineTax, - invoice.InvoiceTax, - invoice.PayInvoiceStart, - invoice.PayInvoiceAsk, - invoice.CreditInvoiceStart, - invoice.InvoiceReportRevision, - party.Address, - party.ContactMechanism, - party.Party, - party.PartyPaymentTerm, - account.Configuration, - account.ConfigurationDefaultPaymentTerm, - account.InvoiceSequence, - # Match pattern migration fallbacks to Fiscalyear values so Period - # must be registered before Fiscalyear - account.Period, - account.FiscalYear, - account.Move, - account.MoveLine, - account.Reconciliation, - invoice.PaymentMethod, - company.Company, - module='account_invoice', type_='model') - Pool.register( - payment_term.TestPaymentTerm, - invoice.PayInvoice, - invoice.CreditInvoice, - invoice.RescheduleLinesToPay, - invoice.DelegateLinesToPay, - invoice.RefreshInvoiceReport, - party.Replace, - party.Erase, - account.RenewFiscalYear, - account.RescheduleLines, - account.DelegateLines, - account.CancelMoves, - module='account_invoice', type_='wizard') - Pool.register( - invoice.InvoiceReport, - module='account_invoice', type_='report') diff --git a/modules/account_invoice/tryton.cfg b/modules/account_invoice/tryton.cfg index 634e3f8061..51d689cb8b 100644 --- a/modules/account_invoice/tryton.cfg +++ b/modules/account_invoice/tryton.cfg @@ -16,3 +16,53 @@ xml: account.xml company.xml message.xml + +[register] +model: + payment_term.PaymentTerm + payment_term.PaymentTermLine + payment_term.PaymentTermLineRelativeDelta + payment_term.TestPaymentTermView + payment_term.TestPaymentTermViewResult + invoice.Invoice + invoice.InvoiceAdditionalMove + invoice.AlternativePayee + invoice.InvoicePaymentLine + invoice.InvoiceLine + invoice.InvoiceLineTax + invoice.InvoiceTax + invoice.PayInvoiceStart + invoice.PayInvoiceAsk + invoice.CreditInvoiceStart + invoice.InvoiceReportRevision + party.Address + party.ContactMechanism + party.Party + party.PartyPaymentTerm + account.Configuration + account.ConfigurationDefaultPaymentTerm + account.InvoiceSequence + # Match pattern migration fallbacks to Fiscalyear values so Period + # must be registered before Fiscalyear + account.Period + account.FiscalYear + account.Move + account.MoveLine + account.Reconciliation + invoice.PaymentMethod + company.Company +wizard: + payment_term.TestPaymentTerm + invoice.PayInvoice + invoice.CreditInvoice + invoice.RescheduleLinesToPay + invoice.DelegateLinesToPay + invoice.RefreshInvoiceReport + party.Replace + party.Erase + account.RenewFiscalYear + account.RescheduleLines + account.DelegateLines + account.CancelMoves +report: + invoice.InvoiceReport diff --git a/modules/account_invoice_correction/__init__.py b/modules/account_invoice_correction/__init__.py index cc718c0d38..4effdfa4a2 100644 --- a/modules/account_invoice_correction/__init__.py +++ b/modules/account_invoice_correction/__init__.py @@ -1,17 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import invoice - -__all__ = ['register'] - - -def register(): - Pool.register( - invoice.Invoice, - invoice.InvoiceCorrectStart, - module='account_invoice_correction', type_='model') - Pool.register( - invoice.InvoiceCorrect, - module='account_invoice_correction', type_='wizard') diff --git a/modules/account_invoice_correction/tryton.cfg b/modules/account_invoice_correction/tryton.cfg index fe742b6ff0..697d1d5265 100644 --- a/modules/account_invoice_correction/tryton.cfg +++ b/modules/account_invoice_correction/tryton.cfg @@ -5,3 +5,10 @@ depends: account_invoice xml: invoice.xml + +[register] +model: + invoice.Invoice + invoice.InvoiceCorrectStart +wizard: + invoice.InvoiceCorrect diff --git a/modules/account_invoice_defer/__init__.py b/modules/account_invoice_defer/__init__.py index d8edf65447..4effdfa4a2 100644 --- a/modules/account_invoice_defer/__init__.py +++ b/modules/account_invoice_defer/__init__.py @@ -1,25 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.Configuration, - account.ConfigurationDefaultAccount, - account.InvoiceDeferred, - account.Move, - account.Period, - account.Invoice, - account.InvoiceLine, - module='account_invoice_defer', type_='model') - Pool.register( - account.InvoiceDeferredCreateMoves, - module='account_invoice_defer', type_='wizard') - Pool.register( - module='account_invoice_defer', type_='report') diff --git a/modules/account_invoice_defer/tryton.cfg b/modules/account_invoice_defer/tryton.cfg index 753f03ff4f..506e7cee3d 100644 --- a/modules/account_invoice_defer/tryton.cfg +++ b/modules/account_invoice_defer/tryton.cfg @@ -8,3 +8,15 @@ depends: xml: account.xml message.xml + +[register] +model: + account.Configuration + account.ConfigurationDefaultAccount + account.InvoiceDeferred + account.Move + account.Period + account.Invoice + account.InvoiceLine +wizard: + account.InvoiceDeferredCreateMoves diff --git a/modules/account_invoice_history/__init__.py b/modules/account_invoice_history/__init__.py index 11d7808797..4effdfa4a2 100644 --- a/modules/account_invoice_history/__init__.py +++ b/modules/account_invoice_history/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, account_invoice, party - - -def register(): - Pool.register( - party.Party, - party.Address, - party.Identifier, - account.Invoice, - account_invoice.PaymentTerm, - account_invoice.PaymentTermLine, - account_invoice.PaymentTermLineRelativeDelta, - module='account_invoice_history', type_='model') diff --git a/modules/account_invoice_history/tryton.cfg b/modules/account_invoice_history/tryton.cfg index 03d2bf72c0..12b7497981 100644 --- a/modules/account_invoice_history/tryton.cfg +++ b/modules/account_invoice_history/tryton.cfg @@ -3,3 +3,13 @@ version=7.7.0 depends: account_invoice party + +[register] +model: + party.Party + party.Address + party.Identifier + account.Invoice + account_invoice.PaymentTerm + account_invoice.PaymentTermLine + account_invoice.PaymentTermLineRelativeDelta diff --git a/modules/account_invoice_line_standalone/__init__.py b/modules/account_invoice_line_standalone/__init__.py index 7a9d94b1a8..4effdfa4a2 100644 --- a/modules/account_invoice_line_standalone/__init__.py +++ b/modules/account_invoice_line_standalone/__init__.py @@ -1,13 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import invoice - - -def register(): - Pool.register( - invoice.Invoice, - invoice.InvoiceLine, - module='account_invoice_line_standalone', type_='model') diff --git a/modules/account_invoice_line_standalone/tryton.cfg b/modules/account_invoice_line_standalone/tryton.cfg index 595b597423..829365a9c6 100644 --- a/modules/account_invoice_line_standalone/tryton.cfg +++ b/modules/account_invoice_line_standalone/tryton.cfg @@ -5,3 +5,8 @@ depends: ir xml: invoice.xml + +[register] +model: + invoice.Invoice + invoice.InvoiceLine diff --git a/modules/account_invoice_secondary_unit/__init__.py b/modules/account_invoice_secondary_unit/__init__.py index f3ccf7fd22..4effdfa4a2 100644 --- a/modules/account_invoice_secondary_unit/__init__.py +++ b/modules/account_invoice_secondary_unit/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.InvoiceLine, - module='account_invoice_secondary_unit', type_='model') diff --git a/modules/account_invoice_secondary_unit/tryton.cfg b/modules/account_invoice_secondary_unit/tryton.cfg index e491e32b8e..b9c8354bf4 100644 --- a/modules/account_invoice_secondary_unit/tryton.cfg +++ b/modules/account_invoice_secondary_unit/tryton.cfg @@ -6,3 +6,7 @@ depends: product xml: account.xml + +[register] +model: + account.InvoiceLine diff --git a/modules/account_invoice_stock/__init__.py b/modules/account_invoice_stock/__init__.py index 9a080f0aa1..4effdfa4a2 100644 --- a/modules/account_invoice_stock/__init__.py +++ b/modules/account_invoice_stock/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, stock - - -def register(): - Pool.register( - account.Invoice, - account.InvoiceLineStockMove, - account.InvoiceLine, - stock.Move, - stock.ShipmentOut, - module='account_invoice_stock', type_='model') diff --git a/modules/account_invoice_stock/tryton.cfg b/modules/account_invoice_stock/tryton.cfg index ef90e72c3a..f49b0f1435 100644 --- a/modules/account_invoice_stock/tryton.cfg +++ b/modules/account_invoice_stock/tryton.cfg @@ -8,3 +8,11 @@ depends: xml: account.xml stock.xml + +[register] +model: + account.Invoice + account.InvoiceLineStockMove + account.InvoiceLine + stock.Move + stock.ShipmentOut diff --git a/modules/account_invoice_watermark/__init__.py b/modules/account_invoice_watermark/__init__.py index 3c168aa5c5..4effdfa4a2 100644 --- a/modules/account_invoice_watermark/__init__.py +++ b/modules/account_invoice_watermark/__init__.py @@ -1,15 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.Invoice, - account.InvoiceWatermark, - module='account_invoice_watermark', type_='report') diff --git a/modules/account_invoice_watermark/tryton.cfg b/modules/account_invoice_watermark/tryton.cfg index a73c28701d..5ca4eb581b 100644 --- a/modules/account_invoice_watermark/tryton.cfg +++ b/modules/account_invoice_watermark/tryton.cfg @@ -5,3 +5,8 @@ depends: ir xml: account.xml + +[register] +report: + account.Invoice + account.InvoiceWatermark diff --git a/modules/account_move_line_grouping/__init__.py b/modules/account_move_line_grouping/__init__.py index 77ea169708..4effdfa4a2 100644 --- a/modules/account_move_line_grouping/__init__.py +++ b/modules/account_move_line_grouping/__init__.py @@ -1,20 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.Move, - account.MoveLine, - account.MoveLineGroup, - account.MoveLineGroup_MoveLine, - module='account_move_line_grouping', type_='model') - Pool.register( - account.OpenAccount, - module='account_move_line_grouping', type_='wizard') diff --git a/modules/account_move_line_grouping/tryton.cfg b/modules/account_move_line_grouping/tryton.cfg index f81409ba54..f314045cf0 100644 --- a/modules/account_move_line_grouping/tryton.cfg +++ b/modules/account_move_line_grouping/tryton.cfg @@ -5,3 +5,12 @@ depends: ir xml: account.xml + +[register] +model: + account.Move + account.MoveLine + account.MoveLineGroup + account.MoveLineGroup_MoveLine +wizard: + account.OpenAccount diff --git a/modules/account_payment/__init__.py b/modules/account_payment/__init__.py index c5c9c0724d..4effdfa4a2 100644 --- a/modules/account_payment/__init__.py +++ b/modules/account_payment/__init__.py @@ -1,49 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import account, party, payment - - -def register(): - Pool.register( - payment.Journal, - payment.Group, - payment.Payment, - account.MoveLine, - account.CreateDirectDebitStart, - account.PayLineStart, - account.PayLineAskJournal, - account.Configuration, - account.ConfigurationPaymentSequence, - account.ConfigurationPaymentGroupSequence, - party.Party, - party.PartyPaymentDirectDebit, - party.PartyReceptionDirectDebit, - module='account_payment', type_='model') - Pool.register( - account.Invoice, - module='account_payment', type_='model', depends=['account_invoice']) - Pool.register( - account.Statement, - account.StatementLine, - module='account_payment', type_='model', depends=['account_statement']) - Pool.register( - account.StatementRule, - account.StatementRuleLine, - module='account_payment', type_='model', - depends=['account_statement_rule']) - Pool.register( - account.Dunning, - module='account_payment', type_='model', depends=['account_dunning']) - Pool.register( - payment.ProcessPayment, - account.CreateDirectDebit, - account.PayLine, - account.MoveCancel, - account.MoveLineGroup, - account.MoveLineReschedule, - account.MoveLineDelegate, - party.Replace, - party.Erase, - module='account_payment', type_='wizard') diff --git a/modules/account_payment/tryton.cfg b/modules/account_payment/tryton.cfg index 5036fe885c..fcd39fb1eb 100644 --- a/modules/account_payment/tryton.cfg +++ b/modules/account_payment/tryton.cfg @@ -17,3 +17,47 @@ xml: account.xml party.xml message.xml + +[register] +model: + payment.Journal + payment.Group + payment.Payment + account.MoveLine + account.CreateDirectDebitStart + account.PayLineStart + account.PayLineAskJournal + account.Configuration + account.ConfigurationPaymentSequence + account.ConfigurationPaymentGroupSequence + party.Party + party.PartyPaymentDirectDebit + party.PartyReceptionDirectDebit +wizard: + payment.ProcessPayment + account.CreateDirectDebit + account.PayLine + account.MoveCancel + account.MoveLineGroup + account.MoveLineReschedule + account.MoveLineDelegate + party.Replace + party.Erase + +[register account_dunning] +model: + account.Dunning + +[register account_invoice] +model: + account.Invoice + +[register account_statement] +model: + account.Statement + account.StatementLine + +[register account_statement_rule] +model: + account.StatementRule + account.StatementRuleLine diff --git a/modules/account_payment_braintree/__init__.py b/modules/account_payment_braintree/__init__.py index 964dd68948..aed6e0e6c7 100644 --- a/modules/account_payment_braintree/__init__.py +++ b/modules/account_payment_braintree/__init__.py @@ -1,31 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool +from . import routes -from . import account, ir, party, routes - -__all__ = ['register', 'routes'] - - -def register(): - Pool.register( - ir.Cron, - account.PaymentJournal, - account.PaymentGroup, - account.Payment, - account.PaymentBraintreeRefund, - account.PaymentBraintreeAccount, - account.PaymentBraintreeCustomer, - account.PaymentBraintreeCustomerIdentical, - account.PaymentBraintreeCustomerPaymentMethodDeleteAsk, - party.Party, - party.PartyReceptionDirectDebit, - module='account_payment_braintree', type_='model') - Pool.register( - account.PaymentBraintreeCustomerPaymentMethodDelete, - party.Replace, - module='account_payment_braintree', type_='wizard') - Pool.register( - account.PaymentBraintreeCheckoutPage, - module='account_payment_braintree', type_='report') +__all__ = [routes] diff --git a/modules/account_payment_braintree/tryton.cfg b/modules/account_payment_braintree/tryton.cfg index 8bce507f4b..d062830777 100644 --- a/modules/account_payment_braintree/tryton.cfg +++ b/modules/account_payment_braintree/tryton.cfg @@ -10,3 +10,23 @@ xml: account.xml party.xml message.xml + +[register] +model: + ir.Cron + party.Party + party.PartyReceptionDirectDebit + account.PaymentJournal + account.PaymentGroup + account.Payment + account.PaymentBraintreeRefund + account.PaymentBraintreeAccount + account.PaymentBraintreeCustomer + account.PaymentBraintreeCustomerIdentical + account.PaymentBraintreeCustomerPaymentMethodDeleteAsk +wizard: + account.PaymentBraintreeCustomerPaymentMethodDelete + party.Replace +report: + account.PaymentBraintreeCheckoutPage + diff --git a/modules/account_payment_clearing/__init__.py b/modules/account_payment_clearing/__init__.py index ca97d6317d..4effdfa4a2 100644 --- a/modules/account_payment_clearing/__init__.py +++ b/modules/account_payment_clearing/__init__.py @@ -1,33 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import account, ir, party, payment, statement - - -def register(): - Pool.register( - party.PartyReceptionDirectDebit, - payment.Journal, - payment.Payment, - payment.Group, - payment.SucceedStart, - account.Move, - account.MoveReconciliation, - ir.Cron, - module='account_payment_clearing', type_='model') - Pool.register( - statement.Payment, - statement.PaymentGroup, - statement.Statement, - statement.StatementLine, - module='account_payment_clearing', type_='model', - depends=['account_statement']) - Pool.register( - statement.StatementRule, - statement.StatementRuleLine, - module='account_payment_clearing', type_='model', - depends=['account_statement_rule']) - Pool.register( - payment.Succeed, - module='account_payment_clearing', type_='wizard') diff --git a/modules/account_payment_clearing/tryton.cfg b/modules/account_payment_clearing/tryton.cfg index 769a97a61e..cf2d70da95 100644 --- a/modules/account_payment_clearing/tryton.cfg +++ b/modules/account_payment_clearing/tryton.cfg @@ -10,3 +10,28 @@ extras_depend: account_statement_rule xml: payment.xml + +[register] +model: + ir.Cron + party.PartyReceptionDirectDebit + payment.Journal + payment.Payment + payment.Group + payment.SucceedStart + account.Move + account.MoveReconciliation +wizard: + payment.Succeed + +[register account_statement] +model: + statement.Payment + statement.PaymentGroup + statement.Statement + statement.StatementLine + +[register account_statement_rule] +model: + statement.StatementRule + statement.StatementRuleLine diff --git a/modules/account_payment_sepa/__init__.py b/modules/account_payment_sepa/__init__.py index 181f298e5a..4effdfa4a2 100644 --- a/modules/account_payment_sepa/__init__.py +++ b/modules/account_payment_sepa/__init__.py @@ -1,27 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import account, party, payment - - -def register(): - Pool.register( - payment.Journal, - payment.Group, - payment.Mandate, - payment.Payment, - payment.Message, - party.Party, - party.PartyReceptionDirectDebit, - party.PartyIdentifier, - account.Configuration, - account.ConfigurationSepaMandateSequence, - module='account_payment_sepa', type_='model') - Pool.register( - party.Replace, - module='account_payment_sepa', type_='wizard') - Pool.register( - payment.MandateReport, - payment.MessageReport, - module='account_payment_sepa', type_='report') diff --git a/modules/account_payment_sepa/tryton.cfg b/modules/account_payment_sepa/tryton.cfg index fa7f499e78..adeba6c03d 100644 --- a/modules/account_payment_sepa/tryton.cfg +++ b/modules/account_payment_sepa/tryton.cfg @@ -14,3 +14,21 @@ xml: party.xml account.xml message.xml + +[register] +model: + payment.Journal + payment.Group + payment.Mandate + payment.Payment + payment.Message + party.Party + party.PartyReceptionDirectDebit + party.PartyIdentifier + account.Configuration + account.ConfigurationSepaMandateSequence +wizard: + party.Replace +report: + payment.MandateReport + payment.MessageReport diff --git a/modules/account_payment_sepa_cfonb/__init__.py b/modules/account_payment_sepa_cfonb/__init__.py index 81b87bb6f8..4effdfa4a2 100644 --- a/modules/account_payment_sepa_cfonb/__init__.py +++ b/modules/account_payment_sepa_cfonb/__init__.py @@ -1,12 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import payment - - -def register(): - Pool.register( - payment.Journal, - payment.Group, - module='account_payment_sepa_cfonb', type_='model') diff --git a/modules/account_payment_sepa_cfonb/tryton.cfg b/modules/account_payment_sepa_cfonb/tryton.cfg index ad4157f3d5..cd2ebef753 100644 --- a/modules/account_payment_sepa_cfonb/tryton.cfg +++ b/modules/account_payment_sepa_cfonb/tryton.cfg @@ -6,3 +6,8 @@ depends: company bank party + +[register] +model: + payment.Journal + payment.Group diff --git a/modules/account_payment_stripe/__init__.py b/modules/account_payment_stripe/__init__.py index eb83359b8a..aed6e0e6c7 100644 --- a/modules/account_payment_stripe/__init__.py +++ b/modules/account_payment_stripe/__init__.py @@ -1,32 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool +from . import routes -from . import ir, party, payment, routes - -__all__ = ['register', 'routes'] - - -def register(): - Pool.register( - payment.Account, - payment.Refund, - payment.Customer, - payment.CustomerFingerprint, - payment.CustomerIdentical, - payment.Journal, - payment.Group, - payment.Payment, - payment.CustomerSourceDetachAsk, - party.Party, - party.PartyReceptionDirectDebit, - ir.Cron, - module='account_payment_stripe', type_='model') - Pool.register( - payment.CustomerSourceDetach, - party.Replace, - module='account_payment_stripe', type_='wizard') - Pool.register( - payment.CheckoutPage, - module='account_payment_stripe', type_='report') +__all__ = [routes] diff --git a/modules/account_payment_stripe/tryton.cfg b/modules/account_payment_stripe/tryton.cfg index dd5c916ebb..14dd84aac4 100644 --- a/modules/account_payment_stripe/tryton.cfg +++ b/modules/account_payment_stripe/tryton.cfg @@ -9,3 +9,23 @@ xml: payment.xml party.xml message.xml + +[register] +model: + ir.Cron + party.Party + party.PartyReceptionDirectDebit + payment.Account + payment.Refund + payment.Customer + payment.CustomerFingerprint + payment.CustomerIdentical + payment.Journal + payment.Group + payment.Payment + payment.CustomerSourceDetachAsk +wizard: + payment.CustomerSourceDetach + party.Replace +report: + payment.CheckoutPage diff --git a/modules/account_product/__init__.py b/modules/account_product/__init__.py index c635c374dc..4effdfa4a2 100644 --- a/modules/account_product/__init__.py +++ b/modules/account_product/__init__.py @@ -1,29 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, analytic_account, configuration, product - - -def register(): - Pool.register( - product.Category, - product.CategoryAccount, - product.CategoryCustomerTax, - product.CategorySupplierTax, - account.CreateChartProperties, - product.Template, - product.Product, - product.TemplateAccountCategory, - product.TemplateCategoryAll, - configuration.Configuration, - configuration.ConfigurationDefaultAccount, - module='account_product', type_='model') - Pool.register( - account.MoveLine, - analytic_account.Rule, - module='account_product', type_='model', depends=['analytic_account']) - Pool.register( - account.CreateChart, - module='account_product', type_='wizard') diff --git a/modules/account_product/tryton.cfg b/modules/account_product/tryton.cfg index 6ab54f7914..d8ae638543 100644 --- a/modules/account_product/tryton.cfg +++ b/modules/account_product/tryton.cfg @@ -13,3 +13,25 @@ xml: configuration.xml message.xml analytic_account.xml + +[register] +model: + product.Category + product.CategoryAccount + product.CategoryCustomerTax + product.CategorySupplierTax + account.CreateChartProperties + product.Template + product.Product + product.TemplateAccountCategory + product.TemplateCategoryAll + configuration.Configuration + configuration.ConfigurationDefaultAccount +wizard: + account.CreateChart + +[register analytic_account] +model: + account.MoveLine + analytic_account.Rule + diff --git a/modules/account_receivable_rule/__init__.py b/modules/account_receivable_rule/__init__.py index cc57203175..5cbbdd5bce 100644 --- a/modules/account_receivable_rule/__init__.py +++ b/modules/account_receivable_rule/__init__.py @@ -1,27 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import account, ir -from .account import AccountRuleAbstract, AccountRuleAccountAbstract - -__all__ = ['register', 'AccountRuleAbstract', 'AccountRuleAccountAbstract'] +__all__ = ['AccountRuleAbstract', 'AccountRuleAccountAbstract'] -def register(): - Pool.register( - ir.Cron, - account.Account, - account.Move, - account.AccountReceivableRule, - account.AccountReceivableRuleAccount, - module='account_receivable_rule', type_='model') - Pool.register( - account.AccountReceivableRule_Dunning, - module='account_receivable_rule', type_='model', - depends=['account_dunning']) - Pool.register( - account.Statement, - module='account_receivable_rule', type_='model', - depends=['account_statement']) +def __getattr__(name): + if name in {'AccountRuleAbstract', 'AccountRuleAccountAbstract'}: + from . import account + return getattr(account, name) + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/account_receivable_rule/tryton.cfg b/modules/account_receivable_rule/tryton.cfg index 676bf5a6ff..fa1e0bcae0 100644 --- a/modules/account_receivable_rule/tryton.cfg +++ b/modules/account_receivable_rule/tryton.cfg @@ -11,3 +11,19 @@ extras_depend: xml: account.xml message.xml + +[register] +model: + ir.Cron + account.Account + account.Move + account.AccountReceivableRule + account.AccountReceivableRuleAccount + +[register account_dunning] +model: + account.AccountReceivableRule_Dunning + +[register account_statement] +model: + account.Statement diff --git a/modules/account_rule/__init__.py b/modules/account_rule/__init__.py index b166a2b27d..4effdfa4a2 100644 --- a/modules/account_rule/__init__.py +++ b/modules/account_rule/__init__.py @@ -1,40 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, party, product, purchase, sale, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - account.Configuration, - account.AccountRule, - party.Party, - module='account_rule', type_='model') - Pool.register( - account.AccountRuleStock, - module='account_rule', type_='model', depends=['stock']) - Pool.register( - product.Category, - product.Template, - module='account_rule', type_='model', depends=['product']) - Pool.register( - account.InvoiceLine, - module='account_rule', type_='model', depends=['account_invoice']) - Pool.register( - account.InvoiceLineStock, - module='account_rule', type_='model', - depends=['account_invoice_stock']) - Pool.register( - purchase.Line, - module='account_rule', type_='model', depends=['purchase']) - Pool.register( - sale.Line, - module='account_rule', type_='model', depends=['sale']) - Pool.register( - stock.Move, - module='account_rule', type_='model', - depends=['stock']) diff --git a/modules/account_rule/tryton.cfg b/modules/account_rule/tryton.cfg index 1fdc1da8a1..a1aea3dc00 100644 --- a/modules/account_rule/tryton.cfg +++ b/modules/account_rule/tryton.cfg @@ -19,3 +19,35 @@ extras_depend: stock_consignment xml: account.xml + +[register] +model: + account.Configuration + account.AccountRule + party.Party + +[register account_invoice] +model: + account.InvoiceLine + +[register account_invoice_stock] +model: + account.InvoiceLineStock + +[register product] +model: + product.Category + product.Template + +[register purchase] +model: + purchase.Line + +[register sale] +model: + sale.Line + +[register stock] +model: + stock.Move + account.AccountRuleStock diff --git a/modules/account_statement/__init__.py b/modules/account_statement/__init__.py index 931fbad959..4effdfa4a2 100644 --- a/modules/account_statement/__init__.py +++ b/modules/account_statement/__init__.py @@ -1,30 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, bank, journal, party, statement - - -def register(): - Pool.register( - bank.Account, - journal.Journal, - statement.Statement, - statement.Line, - statement.LineGroup, - account.Journal, - account.Move, - account.MoveLine, - statement.Origin, - statement.OriginInformation, - statement.ImportStatementStart, - module='account_statement', type_='model') - Pool.register( - party.Replace, - statement.ImportStatement, - statement.ReconcileStatement, - module='account_statement', type_='wizard') - Pool.register( - statement.StatementReport, - module='account_statement', type_='report') diff --git a/modules/account_statement/tryton.cfg b/modules/account_statement/tryton.cfg index 26060fedce..e38b41b7f6 100644 --- a/modules/account_statement/tryton.cfg +++ b/modules/account_statement/tryton.cfg @@ -12,3 +12,23 @@ xml: statement.xml journal.xml message.xml + +[register] +model: + bank.Account + journal.Journal + statement.Statement + statement.Line + statement.LineGroup + account.Journal + account.Move + account.MoveLine + statement.Origin + statement.OriginInformation + statement.ImportStatementStart +wizard: + party.Replace + statement.ImportStatement + statement.ReconcileStatement +report: + statement.StatementReport diff --git a/modules/account_statement_aeb43/__init__.py b/modules/account_statement_aeb43/__init__.py index d72af81792..4effdfa4a2 100644 --- a/modules/account_statement_aeb43/__init__.py +++ b/modules/account_statement_aeb43/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import statement - -__all__ = ['register'] - - -def register(): - Pool.register( - statement.ImportStatementStart, - module='account_statement_aeb43', type_='model') - Pool.register( - statement.ImportStatement, - module='account_statement_aeb43', type_='wizard') diff --git a/modules/account_statement_aeb43/tryton.cfg b/modules/account_statement_aeb43/tryton.cfg index 1d82c88e2a..9fe4397575 100644 --- a/modules/account_statement_aeb43/tryton.cfg +++ b/modules/account_statement_aeb43/tryton.cfg @@ -6,3 +6,9 @@ depends: ir xml: statement.xml + +[register] +model: + statement.ImportStatementStart +wizard: + statement.ImportStatement diff --git a/modules/account_statement_coda/__init__.py b/modules/account_statement_coda/__init__.py index 11fab90eca..4effdfa4a2 100644 --- a/modules/account_statement_coda/__init__.py +++ b/modules/account_statement_coda/__init__.py @@ -1,19 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.StatementImportStart, - module='account_statement_coda', type_='model') - Pool.register( - account.StatementImport, - module='account_statement_coda', type_='wizard') - Pool.register( - module='account_statement_coda', type_='report') diff --git a/modules/account_statement_coda/tryton.cfg b/modules/account_statement_coda/tryton.cfg index 3eaf592eb4..7df883b7df 100644 --- a/modules/account_statement_coda/tryton.cfg +++ b/modules/account_statement_coda/tryton.cfg @@ -6,3 +6,9 @@ depends: ir xml: account.xml + +[register] +model: + account.StatementImportStart +wizard: + account.StatementImport diff --git a/modules/account_statement_mt940/__init__.py b/modules/account_statement_mt940/__init__.py index 7c99b8d1bf..4effdfa4a2 100644 --- a/modules/account_statement_mt940/__init__.py +++ b/modules/account_statement_mt940/__init__.py @@ -1,19 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.StatementImportStart, - module='account_statement_mt940', type_='model') - Pool.register( - account.StatementImport, - module='account_statement_mt940', type_='wizard') - Pool.register( - module='account_statement_mt940', type_='report') diff --git a/modules/account_statement_mt940/tryton.cfg b/modules/account_statement_mt940/tryton.cfg index 3eaf592eb4..7df883b7df 100644 --- a/modules/account_statement_mt940/tryton.cfg +++ b/modules/account_statement_mt940/tryton.cfg @@ -6,3 +6,9 @@ depends: ir xml: account.xml + +[register] +model: + account.StatementImportStart +wizard: + account.StatementImport diff --git a/modules/account_statement_ofx/__init__.py b/modules/account_statement_ofx/__init__.py index 0bbed15cd0..4effdfa4a2 100644 --- a/modules/account_statement_ofx/__init__.py +++ b/modules/account_statement_ofx/__init__.py @@ -1,19 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.StatementImportStart, - module='account_statement_ofx', type_='model') - Pool.register( - account.StatementImport, - module='account_statement_ofx', type_='wizard') - Pool.register( - module='account_statement_ofx', type_='report') diff --git a/modules/account_statement_ofx/tryton.cfg b/modules/account_statement_ofx/tryton.cfg index 4322a05842..ce5fa31e42 100644 --- a/modules/account_statement_ofx/tryton.cfg +++ b/modules/account_statement_ofx/tryton.cfg @@ -8,3 +8,9 @@ depends: xml: account.xml message.xml + +[register] +model: + account.StatementImportStart +wizard: + account.StatementImport diff --git a/modules/account_statement_rule/__init__.py b/modules/account_statement_rule/__init__.py index c3360bafa7..4effdfa4a2 100644 --- a/modules/account_statement_rule/__init__.py +++ b/modules/account_statement_rule/__init__.py @@ -1,22 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.Statement, - account.StatementOrigin, - account.StatementRule, - account.StatementRuleInformation, - account.StatementRuleLine, - module='account_statement_rule', type_='model') - Pool.register( - module='account_statement_rule', type_='wizard') - Pool.register( - module='account_statement_rule', type_='report') diff --git a/modules/account_statement_rule/tryton.cfg b/modules/account_statement_rule/tryton.cfg index 74b9216255..6157271647 100644 --- a/modules/account_statement_rule/tryton.cfg +++ b/modules/account_statement_rule/tryton.cfg @@ -11,3 +11,12 @@ extras_depend: bank xml: account.xml + +[register] +model: + account.Statement + account.StatementOrigin + account.StatementRule + account.StatementRuleInformation + account.StatementRuleLine + diff --git a/modules/account_statement_sepa/__init__.py b/modules/account_statement_sepa/__init__.py index 149a6808f9..4effdfa4a2 100644 --- a/modules/account_statement_sepa/__init__.py +++ b/modules/account_statement_sepa/__init__.py @@ -1,17 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.StatementImportStart, - module='account_statement_sepa', type_='model') - Pool.register( - account.StatementImport, - module='account_statement_sepa', type_='wizard') diff --git a/modules/account_statement_sepa/tryton.cfg b/modules/account_statement_sepa/tryton.cfg index 3eaf592eb4..7df883b7df 100644 --- a/modules/account_statement_sepa/tryton.cfg +++ b/modules/account_statement_sepa/tryton.cfg @@ -6,3 +6,9 @@ depends: ir xml: account.xml + +[register] +model: + account.StatementImportStart +wizard: + account.StatementImport diff --git a/modules/account_stock_anglo_saxon/__init__.py b/modules/account_stock_anglo_saxon/__init__.py index 94d954a225..4effdfa4a2 100644 --- a/modules/account_stock_anglo_saxon/__init__.py +++ b/modules/account_stock_anglo_saxon/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, invoice, product, stock - - -def register(): - Pool.register( - product.Category, - product.CategoryAccount, - product.Template, - product.Product, - stock.Move, - invoice.InvoiceLine, - account.FiscalYear, - module='account_stock_anglo_saxon', type_='model') diff --git a/modules/account_stock_anglo_saxon/tryton.cfg b/modules/account_stock_anglo_saxon/tryton.cfg index 5f69a97baf..51a818a5b6 100644 --- a/modules/account_stock_anglo_saxon/tryton.cfg +++ b/modules/account_stock_anglo_saxon/tryton.cfg @@ -11,3 +11,13 @@ depends: xml: product.xml message.xml + +[register] +model: + product.Category + product.CategoryAccount + product.Template + product.Product + account.FiscalYear + invoice.InvoiceLine + stock.Move diff --git a/modules/account_stock_continental/__init__.py b/modules/account_stock_continental/__init__.py index 589f5ab1fb..4effdfa4a2 100644 --- a/modules/account_stock_continental/__init__.py +++ b/modules/account_stock_continental/__init__.py @@ -1,20 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, product, stock - - -def register(): - Pool.register( - stock.Move, - product.Category, - product.CategoryAccount, - product.Template, - product.Product, - account.Configuration, - account.ConfigurationStockJournal, - account.FiscalYear, - account.AccountMove, - module='account_stock_continental', type_='model') diff --git a/modules/account_stock_continental/tryton.cfg b/modules/account_stock_continental/tryton.cfg index 41a1092722..61e9aab51a 100644 --- a/modules/account_stock_continental/tryton.cfg +++ b/modules/account_stock_continental/tryton.cfg @@ -10,3 +10,16 @@ depends: xml: product.xml account.xml + +[register] +model: + product.Category + product.CategoryAccount + product.Template + product.Product + account.Configuration + account.ConfigurationStockJournal + account.FiscalYear + account.AccountMove + stock.Move + diff --git a/modules/account_stock_eu/__init__.py b/modules/account_stock_eu/__init__.py index 11f293b695..4effdfa4a2 100644 --- a/modules/account_stock_eu/__init__.py +++ b/modules/account_stock_eu/__init__.py @@ -1,67 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import ( - account, account_stock_eu, carrier, company, country, customs, sale, stock) - -__all__ = ['register'] - - -def register(): - Pool.register( - country.Country, - country.Subdivision, - company.Company, - account.FiscalYear, - account_stock_eu.IntrastatTransaction, - account_stock_eu.IntrastatTransport, - account_stock_eu.IntrastatDeclaration, - account_stock_eu.IntrastatDeclarationContext, - account_stock_eu.IntrastatDeclarationLine, - account_stock_eu.IntrastatDeclarationExportResult, - customs.TariffCode, - stock.Move, - stock.ShipmentIn, - stock.ShipmentInReturn, - stock.ShipmentOut, - stock.ShipmentOutReturn, - stock.ShipmentInternal, - module='account_stock_eu', type_='model') - Pool.register( - stock.Move_Production, - module='account_stock_eu', type_='model', - depends=['production']) - Pool.register( - account_stock_eu.IntrastatDeclarationLine_Incoterm, - stock.Move_Incoterm, - module='account_stock_eu', type_='model', - depends=['incoterm']) - Pool.register( - sale.Sale_Incoterm, - module='account_stock_eu', type_='model', - depends=['sale', 'incoterm']) - Pool.register( - stock.Move_Consignment, - module='account_stock_eu', type_='model', - depends=['stock_consignment']) - Pool.register( - stock.ShipmentDrop, - module='account_stock_eu', type_='model', - depends=['sale_supply_drop_shipment']) - Pool.register( - carrier.Carrier, - module='account_stock_eu', type_='model', - depends=['carrier', 'incoterm']) - Pool.register( - account_stock_eu.IntrastatDeclarationExport, - account_stock_eu.IntrastatDeclarationExport_BE, - account_stock_eu.IntrastatDeclarationExport_ES, - module='account_stock_eu', type_='wizard') - Pool.register( - account_stock_eu.IntrastatDeclarationExport_Incoterm, - account_stock_eu.IntrastatDeclarationExport_BE_Incoterm, - account_stock_eu.IntrastatDeclarationExport_ES_Incoterm, - module='account_stock_eu', type_='wizard', - depends=['incoterm']) diff --git a/modules/account_stock_eu/tryton.cfg b/modules/account_stock_eu/tryton.cfg index a71122aade..c58a89141b 100644 --- a/modules/account_stock_eu/tryton.cfg +++ b/modules/account_stock_eu/tryton.cfg @@ -30,3 +30,56 @@ xml: account_stock_eu.xml stock.xml message.xml + +[register] +model: + country.Country + country.Subdivision + company.Company + customs.TariffCode + account.FiscalYear + account_stock_eu.IntrastatTransaction + account_stock_eu.IntrastatTransport + account_stock_eu.IntrastatDeclaration + account_stock_eu.IntrastatDeclarationContext + account_stock_eu.IntrastatDeclarationLine + account_stock_eu.IntrastatDeclarationExportResult + stock.Move + stock.ShipmentIn + stock.ShipmentInReturn + stock.ShipmentOut + stock.ShipmentOutReturn + stock.ShipmentInternal +wizard: + account_stock_eu.IntrastatDeclarationExport + account_stock_eu.IntrastatDeclarationExport_BE + account_stock_eu.IntrastatDeclarationExport_ES + +[register incoterm] +model: + account_stock_eu.IntrastatDeclarationLine_Incoterm + stock.Move_Incoterm +wizard: + account_stock_eu.IntrastatDeclarationExport_Incoterm + account_stock_eu.IntrastatDeclarationExport_BE_Incoterm + account_stock_eu.IntrastatDeclarationExport_ES_Incoterm + +[register incoterm carrier] +model: + carrier.Carrier + +[register incoterm sale] +model: + sale.Sale_Incoterm + +[register sale_supply_drop_shipment] +model: + stock.ShipmentDrop + +[register stock_consignment] +model: + stock.Move_Consignment + +[register production] +model: + stock.Move_Production diff --git a/modules/account_stock_landed_cost/__init__.py b/modules/account_stock_landed_cost/__init__.py index 893b0ab356..4effdfa4a2 100644 --- a/modules/account_stock_landed_cost/__init__.py +++ b/modules/account_stock_landed_cost/__init__.py @@ -1,27 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, product, stock - - -def register(): - Pool.register( - product.Template, - product.Product, - account.Configuration, - account.ConfigurationLandedCostSequence, - account.LandedCost, - account.LandedCost_Shipment, - account.LandedCost_ProductCategory, - account.LandedCost_Product, - account.LandedCostShow, - account.LandedCostShowMove, - account.InvoiceLine, - stock.Move, - module='account_stock_landed_cost', type_='model') - Pool.register( - account.PostLandedCost, - account.ShowLandedCost, - module='account_stock_landed_cost', type_='wizard') diff --git a/modules/account_stock_landed_cost/tryton.cfg b/modules/account_stock_landed_cost/tryton.cfg index 3670434a27..4bd32ba03b 100644 --- a/modules/account_stock_landed_cost/tryton.cfg +++ b/modules/account_stock_landed_cost/tryton.cfg @@ -15,3 +15,22 @@ xml: product.xml stock.xml message.xml + +[register] +model: + product.Template + product.Product + account.Configuration + account.ConfigurationLandedCostSequence + account.LandedCost + account.LandedCost_Shipment + account.LandedCost_ProductCategory + account.LandedCost_Product + account.LandedCostShow + account.LandedCostShowMove + account.InvoiceLine + stock.Move +wizard: + account.PostLandedCost + account.ShowLandedCost + diff --git a/modules/account_stock_landed_cost_weight/__init__.py b/modules/account_stock_landed_cost_weight/__init__.py index 0756ac66ed..4effdfa4a2 100644 --- a/modules/account_stock_landed_cost_weight/__init__.py +++ b/modules/account_stock_landed_cost_weight/__init__.py @@ -1,12 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - - -def register(): - Pool.register( - account.LandedCost, - module='account_stock_landed_cost_weight', type_='model') diff --git a/modules/account_stock_landed_cost_weight/tryton.cfg b/modules/account_stock_landed_cost_weight/tryton.cfg index cdaae5d739..b0f41668cc 100644 --- a/modules/account_stock_landed_cost_weight/tryton.cfg +++ b/modules/account_stock_landed_cost_weight/tryton.cfg @@ -6,3 +6,7 @@ depends: product product_measurements stock_shipment_measurements + +[register] +model: + account.LandedCost diff --git a/modules/account_stock_shipment_cost/__init__.py b/modules/account_stock_shipment_cost/__init__.py index 7eb26445ed..4effdfa4a2 100644 --- a/modules/account_stock_shipment_cost/__init__.py +++ b/modules/account_stock_shipment_cost/__init__.py @@ -1,29 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, product, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - product.Template, - product.Product, - account.Configuration, - account.ConfigurationShipmentCostSequence, - account.ShipmentCost, - account.ShipmentCost_Shipment, - account.ShipmentCost_ShipmentReturn, - account.ShipmentCostShow, - account.ShipmentCostShowShipment, - account.InvoiceLine, - stock.ShipmentOut, - stock.ShipmentOutReturn, - module='account_stock_shipment_cost', type_='model') - Pool.register( - account.PostShipmentCost, - account.ShowShipmentCost, - module='account_stock_shipment_cost', type_='wizard') diff --git a/modules/account_stock_shipment_cost/tryton.cfg b/modules/account_stock_shipment_cost/tryton.cfg index 4241361bc2..536b8898b2 100644 --- a/modules/account_stock_shipment_cost/tryton.cfg +++ b/modules/account_stock_shipment_cost/tryton.cfg @@ -11,3 +11,21 @@ xml: product.xml account.xml message.xml + +[register] +model: + product.Template + product.Product + account.Configuration + account.ConfigurationShipmentCostSequence + account.ShipmentCost + account.ShipmentCost_Shipment + account.ShipmentCost_ShipmentReturn + account.ShipmentCostShow + account.ShipmentCostShowShipment + account.InvoiceLine + stock.ShipmentOut + stock.ShipmentOutReturn +wizard: + account.PostShipmentCost + account.ShowShipmentCost diff --git a/modules/account_stock_shipment_cost_weight/__init__.py b/modules/account_stock_shipment_cost_weight/__init__.py index e325eeec6d..4effdfa4a2 100644 --- a/modules/account_stock_shipment_cost_weight/__init__.py +++ b/modules/account_stock_shipment_cost_weight/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.ShipmentCost, - module='account_stock_shipment_cost_weight', type_='model') diff --git a/modules/account_stock_shipment_cost_weight/tryton.cfg b/modules/account_stock_shipment_cost_weight/tryton.cfg index d3e7ac1baf..0a18205cc2 100644 --- a/modules/account_stock_shipment_cost_weight/tryton.cfg +++ b/modules/account_stock_shipment_cost_weight/tryton.cfg @@ -4,4 +4,7 @@ depends: account_stock_shipment_cost ir stock_shipment_measurements -xml: + +[register] +model: + account.ShipmentCost diff --git a/modules/account_syscohada/__init__.py b/modules/account_syscohada/__init__.py index 14448cab41..4effdfa4a2 100644 --- a/modules/account_syscohada/__init__.py +++ b/modules/account_syscohada/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.CreateChart, - module='account_syscohada', type_='wizard') diff --git a/modules/account_syscohada/tryton.cfg b/modules/account_syscohada/tryton.cfg index 32a9a7f975..b8347ffe52 100644 --- a/modules/account_syscohada/tryton.cfg +++ b/modules/account_syscohada/tryton.cfg @@ -6,3 +6,7 @@ depends: xml: account_syscohada_2001_fr.xml account_syscohada_2016_fr.xml + +[register] +wizard: + account.CreateChart diff --git a/modules/account_tax_cash/__init__.py b/modules/account_tax_cash/__init__.py index ae70b82bd0..4effdfa4a2 100644 --- a/modules/account_tax_cash/__init__.py +++ b/modules/account_tax_cash/__init__.py @@ -1,27 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, party - -__all__ = ['register'] - - -def register(): - Pool.register( - account.FiscalYear, - account.Period, - party.Party, - account.TaxGroupCash, - account.Tax, - account.TaxLine, - account.Move, - account.Invoice, - account.InvoiceTax, - account.InvoiceTaxGroupCash, - module='account_tax_cash', type_='model') - Pool.register( - module='account_tax_cash', type_='wizard') - Pool.register( - module='account_tax_cash', type_='report') diff --git a/modules/account_tax_cash/tryton.cfg b/modules/account_tax_cash/tryton.cfg index 2e0177d889..0343d78353 100644 --- a/modules/account_tax_cash/tryton.cfg +++ b/modules/account_tax_cash/tryton.cfg @@ -9,3 +9,16 @@ xml: account.xml party.xml message.xml + +[register] +model: + account.FiscalYear + account.Period + party.Party + account.TaxGroupCash + account.Tax + account.TaxLine + account.Move + account.Invoice + account.InvoiceTax + account.InvoiceTaxGroupCash diff --git a/modules/account_tax_non_deductible/__init__.py b/modules/account_tax_non_deductible/__init__.py index 6646b95b81..4effdfa4a2 100644 --- a/modules/account_tax_non_deductible/__init__.py +++ b/modules/account_tax_non_deductible/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account - -__all__ = ['register'] - - -def register(): - Pool.register( - account.TaxTemplate, - account.Tax, - account.InvoiceLine, - module='account_tax_non_deductible', type_='model') diff --git a/modules/account_tax_non_deductible/tryton.cfg b/modules/account_tax_non_deductible/tryton.cfg index 9b87a412a4..c7ca96905a 100644 --- a/modules/account_tax_non_deductible/tryton.cfg +++ b/modules/account_tax_non_deductible/tryton.cfg @@ -6,3 +6,9 @@ depends: ir xml: account.xml + +[register] +model: + account.TaxTemplate + account.Tax + account.InvoiceLine diff --git a/modules/account_tax_rule_country/__init__.py b/modules/account_tax_rule_country/__init__.py index 99600edd41..4effdfa4a2 100644 --- a/modules/account_tax_rule_country/__init__.py +++ b/modules/account_tax_rule_country/__init__.py @@ -1,28 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, purchase, sale - - -def register(): - Pool.register( - account.TaxRule, - account.TaxRuleLineTemplate, - account.TaxRuleLine, - module='account_tax_rule_country', type_='model') - Pool.register( - account.InvoiceLine, - module='account_tax_rule_country', type_='model', - depends=['account_invoice']) - Pool.register( - sale.Sale, - sale.Line, - module='account_tax_rule_country', type_='model', - depends=['sale']) - Pool.register( - purchase.Purchase, - purchase.Line, - module='account_tax_rule_country', type_='model', - depends=['purchase']) diff --git a/modules/account_tax_rule_country/tryton.cfg b/modules/account_tax_rule_country/tryton.cfg index 00d84db38c..dc14515507 100644 --- a/modules/account_tax_rule_country/tryton.cfg +++ b/modules/account_tax_rule_country/tryton.cfg @@ -11,3 +11,23 @@ extras_depend: stock_consignment xml: account.xml + +[register] +model: + account.TaxRule + account.TaxRuleLineTemplate + account.TaxRuleLine + +[register account_invoice] +model: + account.InvoiceLine + +[register purchase] +model: + purchase.Purchase + purchase.Line + +[register sale] +model: + sale.Sale + sale.Line diff --git a/modules/analytic_account/__init__.py b/modules/analytic_account/__init__.py index 3fb1f195a8..b295a75beb 100644 --- a/modules/analytic_account/__init__.py +++ b/modules/analytic_account/__init__.py @@ -1,25 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import account, line, rule -from .account import AnalyticMixin - -__all__ = [AnalyticMixin] +__all__ = ['AnalyticMixin'] -def register(): - Pool.register( - account.Account, - account.AccountDistribution, - account.AccountContext, - account.AnalyticAccountEntry, - line.Line, - line.Move, - line.MoveLine, - rule.Rule, - module='analytic_account', type_='model') - Pool.register( - line.OpenAccount, - module='analytic_account', type_='wizard') +def __getattr__(name): + if name == 'AnalyticMixin': + from .account import AnalyticMixin + return AnalyticMixin + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/analytic_account/tryton.cfg b/modules/analytic_account/tryton.cfg index a027a6be0c..f64aef5931 100644 --- a/modules/analytic_account/tryton.cfg +++ b/modules/analytic_account/tryton.cfg @@ -13,3 +13,16 @@ xml: line.xml rule.xml message.xml + +[register] +model: + account.Account + account.AccountDistribution + account.AccountContext + account.AnalyticAccountEntry + line.Line + line.Move + line.MoveLine + rule.Rule +wizard: + line.OpenAccount diff --git a/modules/analytic_budget/__init__.py b/modules/analytic_budget/__init__.py index 91aade03e5..4effdfa4a2 100644 --- a/modules/analytic_budget/__init__.py +++ b/modules/analytic_budget/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import analytic_account - - -def register(): - Pool.register( - analytic_account.BudgetContext, - analytic_account.Budget, - analytic_account.BudgetLine, - analytic_account.CopyBudgetStart, - module='analytic_budget', type_='model') - Pool.register( - analytic_account.CopyBudget, - module='analytic_budget', type_='wizard') diff --git a/modules/analytic_budget/tryton.cfg b/modules/analytic_budget/tryton.cfg index d9ccb6a508..2fab107f24 100644 --- a/modules/analytic_budget/tryton.cfg +++ b/modules/analytic_budget/tryton.cfg @@ -6,3 +6,12 @@ depends: company xml: analytic_account.xml + +[register] +model: + analytic_account.BudgetContext + analytic_account.Budget + analytic_account.BudgetLine + analytic_account.CopyBudgetStart +wizard: + analytic_account.CopyBudget diff --git a/modules/analytic_invoice/__init__.py b/modules/analytic_invoice/__init__.py index 960d6fa14c..4effdfa4a2 100644 --- a/modules/analytic_invoice/__init__.py +++ b/modules/analytic_invoice/__init__.py @@ -1,25 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import asset, invoice - - -def register(): - Pool.register( - invoice.InvoiceLine, - invoice.AnalyticAccountEntry, - module='analytic_invoice', type_='model') - Pool.register( - asset.Asset, - module='analytic_invoice', type_='model', - depends=['account_asset']) - Pool.register( - invoice.InvoiceDeferred, - module='analytic_invoice', type_='model', - depends=['account_invoice_defer']) - Pool.register( - asset.UpdateAsset, - module='analytic_invoice', type_='wizard', - depends=['account_asset']) diff --git a/modules/analytic_invoice/tryton.cfg b/modules/analytic_invoice/tryton.cfg index 00d3758834..3a138ba232 100644 --- a/modules/analytic_invoice/tryton.cfg +++ b/modules/analytic_invoice/tryton.cfg @@ -9,3 +9,19 @@ extras_depend: xml: invoice.xml asset.xml + +[register] +model: + invoice.InvoiceLine + invoice.AnalyticAccountEntry + +[register account_asset] +model: + asset.Asset +wizard: + asset.UpdateAsset + +[register account_invoice_defer] +model: + invoice.InvoiceDeferred + diff --git a/modules/analytic_purchase/__init__.py b/modules/analytic_purchase/__init__.py index c0799645a7..4effdfa4a2 100644 --- a/modules/analytic_purchase/__init__.py +++ b/modules/analytic_purchase/__init__.py @@ -1,13 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import purchase - - -def register(): - Pool.register( - purchase.PurchaseLine, - purchase.AnalyticAccountEntry, - module='analytic_purchase', type_='model') diff --git a/modules/analytic_purchase/tryton.cfg b/modules/analytic_purchase/tryton.cfg index 14a6f4cecf..c822b4f465 100644 --- a/modules/analytic_purchase/tryton.cfg +++ b/modules/analytic_purchase/tryton.cfg @@ -6,3 +6,8 @@ depends: purchase xml: purchase.xml + +[register] +model: + purchase.PurchaseLine + purchase.AnalyticAccountEntry diff --git a/modules/analytic_sale/__init__.py b/modules/analytic_sale/__init__.py index db366afffa..4effdfa4a2 100644 --- a/modules/analytic_sale/__init__.py +++ b/modules/analytic_sale/__init__.py @@ -1,13 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import sale - - -def register(): - Pool.register( - sale.Line, - sale.AnalyticAccountEntry, - module='analytic_sale', type_='model') diff --git a/modules/analytic_sale/tryton.cfg b/modules/analytic_sale/tryton.cfg index 8208cc0b16..e8b90cf09e 100644 --- a/modules/analytic_sale/tryton.cfg +++ b/modules/analytic_sale/tryton.cfg @@ -6,3 +6,8 @@ depends: sale xml: sale.xml + +[register] +model: + sale.Line + sale.AnalyticAccountEntry diff --git a/modules/attendance/__init__.py b/modules/attendance/__init__.py index 2e9178683c..4effdfa4a2 100644 --- a/modules/attendance/__init__.py +++ b/modules/attendance/__init__.py @@ -1,21 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import attendance, ir - -__all__ = ['register'] - - -def register(): - Pool.register( - ir.Rule, - attendance.Line, - attendance.Period, - attendance.SheetLine, - attendance.Sheet, - module='attendance', type_='model') - Pool.register( - attendance.Sheet_Timesheet, - module='attendance', type_='model', depends=['timesheet']) diff --git a/modules/attendance/tryton.cfg b/modules/attendance/tryton.cfg index 0f54f8377a..3aae5b544e 100644 --- a/modules/attendance/tryton.cfg +++ b/modules/attendance/tryton.cfg @@ -8,3 +8,15 @@ extras_depend: xml: attendance.xml message.xml + +[register] +model: + ir.Rule + attendance.Line + attendance.Period + attendance.SheetLine + attendance.Sheet + +[register timesheet] +model: + attendance.Sheet_Timesheet diff --git a/modules/authentication_saml/__init__.py b/modules/authentication_saml/__init__.py index 078885e329..aed6e0e6c7 100644 --- a/modules/authentication_saml/__init__.py +++ b/modules/authentication_saml/__init__.py @@ -3,8 +3,4 @@ from . import routes -__all__ = ['register', 'routes'] - - -def register(): - pass +__all__ = [routes] diff --git a/modules/authentication_saml/tryton.cfg b/modules/authentication_saml/tryton.cfg index afb3e1f8b6..c8464e1b8d 100644 --- a/modules/authentication_saml/tryton.cfg +++ b/modules/authentication_saml/tryton.cfg @@ -2,4 +2,3 @@ version=7.7.0 depends: ir -xml: diff --git a/modules/authentication_sms/__init__.py b/modules/authentication_sms/__init__.py index 43f20f1985..4effdfa4a2 100644 --- a/modules/authentication_sms/__init__.py +++ b/modules/authentication_sms/__init__.py @@ -1,13 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import res - - -def register(): - Pool.register( - res.User, - res.UserLoginSMSCode, - module='authentication_sms', type_='model') diff --git a/modules/authentication_sms/tryton.cfg b/modules/authentication_sms/tryton.cfg index 782948458e..b9771d8b63 100644 --- a/modules/authentication_sms/tryton.cfg +++ b/modules/authentication_sms/tryton.cfg @@ -6,3 +6,8 @@ depends: xml: res.xml message.xml + +[register] +model: + res.User + res.UserLoginSMSCode diff --git a/modules/bank/__init__.py b/modules/bank/__init__.py index 7b5663f8d3..4effdfa4a2 100644 --- a/modules/bank/__init__.py +++ b/modules/bank/__init__.py @@ -1,19 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import bank, party - - -def register(): - Pool.register( - bank.Bank, - bank.Account, - bank.AccountNumber, - bank.AccountParty, - party.Party, - module='bank', type_='model') - Pool.register( - party.Replace, - module='bank', type_='wizard') diff --git a/modules/bank/tryton.cfg b/modules/bank/tryton.cfg index 8b1a3ea978..be6b0a95f7 100644 --- a/modules/bank/tryton.cfg +++ b/modules/bank/tryton.cfg @@ -8,3 +8,13 @@ xml: bank.xml party.xml message.xml + +[register] +model: + bank.Bank + bank.Account + bank.AccountNumber + bank.AccountParty + party.Party +wizard: + party.Replace diff --git a/modules/carrier/__init__.py b/modules/carrier/__init__.py index 80101fa68c..4effdfa4a2 100644 --- a/modules/carrier/__init__.py +++ b/modules/carrier/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import carrier, party - - -def register(): - Pool.register( - carrier.Carrier, - carrier.Selection, - module='carrier', type_='model') - Pool.register( - party.Replace, - module='carrier', type_='wizard') diff --git a/modules/carrier/tryton.cfg b/modules/carrier/tryton.cfg index 25746ff27b..bd1ed30d52 100644 --- a/modules/carrier/tryton.cfg +++ b/modules/carrier/tryton.cfg @@ -8,3 +8,10 @@ depends: res xml: carrier.xml + +[register] +model: + carrier.Carrier + carrier.Selection +wizard: + party.Replace diff --git a/modules/carrier_carriage/__init__.py b/modules/carrier_carriage/__init__.py index 46c0820717..4effdfa4a2 100644 --- a/modules/carrier_carriage/__init__.py +++ b/modules/carrier_carriage/__init__.py @@ -1,34 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, incoterm, sale, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - stock.Carriage, - stock.ShipmentOut, - stock.ShipmentOutReturn, - module='carrier_carriage', type_='model') - Pool.register( - sale.Sale, - sale.Line, - sale.Carriage, - stock.ShipmentCostSale, - stock.Carriage_Sale, - account.InvoiceLine, - module='carrier_carriage', type_='model', - depends=['sale_shipment_cost']) - Pool.register( - stock.Carriage_Purchase, - stock.ShipmentIn, - module='carrier_carriage', type_='model', - depends=['purchase_shipment_cost']) - Pool.register( - incoterm.Incoterm, - module='carrier_carriage', type_='model', - depends=['incoterm']) diff --git a/modules/carrier_carriage/tryton.cfg b/modules/carrier_carriage/tryton.cfg index ee6ce8a61b..9a8c201352 100644 --- a/modules/carrier_carriage/tryton.cfg +++ b/modules/carrier_carriage/tryton.cfg @@ -16,3 +16,27 @@ xml: sale.xml incoterm.xml message.xml + +[register] +model: + stock.Carriage + stock.ShipmentOut + stock.ShipmentOutReturn + +[register incoterm] +model: + incoterm.Incoterm + +[register purchase_shipment_cost] +model: + stock.Carriage_Purchase + stock.ShipmentIn + +[register sale_shipment_cost] +model: + sale.Sale + sale.Line + sale.Carriage + stock.ShipmentCostSale + stock.Carriage_Sale + account.InvoiceLine diff --git a/modules/carrier_percentage/__init__.py b/modules/carrier_percentage/__init__.py index 630bac9e45..4effdfa4a2 100644 --- a/modules/carrier_percentage/__init__.py +++ b/modules/carrier_percentage/__init__.py @@ -1,21 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import carrier, sale, stock - - -def register(): - Pool.register( - carrier.Carrier, - module='carrier_percentage', type_='model') - Pool.register( - stock.ShipmentIn, - module='carrier_percentage', type_='model', - depends=['purchase_shipment_cost']) - Pool.register( - stock.ShipmentOut, - sale.Sale, - module='carrier_percentage', type_='model', - depends=['sale_shipment_cost']) diff --git a/modules/carrier_percentage/tryton.cfg b/modules/carrier_percentage/tryton.cfg index 36a7bb236e..88becc1aff 100644 --- a/modules/carrier_percentage/tryton.cfg +++ b/modules/carrier_percentage/tryton.cfg @@ -11,3 +11,16 @@ extras_depend: stock_shipment_cost xml: carrier.xml + +[register] +model: + carrier.Carrier + +[register purchase_shipment_cost] +model: + stock.ShipmentIn + +[register sale_shipment_cost] +model: + stock.ShipmentOut + sale.Sale diff --git a/modules/carrier_subdivision/__init__.py b/modules/carrier_subdivision/__init__.py index 9b6afaac72..4effdfa4a2 100644 --- a/modules/carrier_subdivision/__init__.py +++ b/modules/carrier_subdivision/__init__.py @@ -1,22 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import carrier, sale - -__all__ = ['register'] - - -def register(): - Pool.register( - carrier.Selection, - module='carrier_subdivision', type_='model') - Pool.register( - sale.Sale, - module='carrier_subdivision', type_='model', - depends=['sale_shipment_cost']) - Pool.register( - sale.Carriage, - module='carrier_subdivision', type_='model', - depends=['carrier_carriage', 'sale_shipment_cost']) diff --git a/modules/carrier_subdivision/tryton.cfg b/modules/carrier_subdivision/tryton.cfg index 3db790f627..a79c1485ff 100644 --- a/modules/carrier_subdivision/tryton.cfg +++ b/modules/carrier_subdivision/tryton.cfg @@ -9,3 +9,15 @@ extras_depend: sale_shipment_cost xml: carrier.xml + +[register] +model: + carrier.Selection + +[register carrier_carriage sale_shipment_cost] +model: + sale.Carriage + +[register sale_shipment_cost] +model: + sale.Sale diff --git a/modules/carrier_weight/__init__.py b/modules/carrier_weight/__init__.py index 9ee7599799..4effdfa4a2 100644 --- a/modules/carrier_weight/__init__.py +++ b/modules/carrier_weight/__init__.py @@ -1,22 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import carrier, sale, stock - - -def register(): - Pool.register( - carrier.Carrier, - carrier.WeightPriceList, - module='carrier_weight', type_='model') - Pool.register( - stock.ShipmentIn, - module='carrier_weight', type_='model', - depends=['purchase_shipment_cost']) - Pool.register( - stock.ShipmentOut, - sale.Sale, - module='carrier_weight', type_='model', - depends=['sale_shipment_cost']) diff --git a/modules/carrier_weight/tryton.cfg b/modules/carrier_weight/tryton.cfg index aef7f1592d..7e47ffc4d0 100644 --- a/modules/carrier_weight/tryton.cfg +++ b/modules/carrier_weight/tryton.cfg @@ -14,3 +14,17 @@ extras_depend: stock_shipment_cost xml: carrier.xml + +[register] +model: + carrier.Carrier + carrier.WeightPriceList + +[register purchase_shipment_cost] +model: + stock.ShipmentIn + +[register sale_shipment_cost] +model: + stock.ShipmentOut + sale.Sale diff --git a/modules/commission/__init__.py b/modules/commission/__init__.py index 4d5aae87b1..4effdfa4a2 100644 --- a/modules/commission/__init__.py +++ b/modules/commission/__init__.py @@ -1,58 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -try: - from trytond.modules.stock.stock_reporting_margin import \ - Abstract as StockReportingMarginAbstract -except ImportError: - StockReportingMarginAbstract = None - -from . import ( - account, commission, commission_reporting, invoice, ir, party, product, - sale, stock, stock_reporting_margin) - - -def register(): - Pool.register( - commission.Plan, - commission.PlanLines, - commission.Agent, - commission.AgentSelection, - commission.Commission, - commission.CreateInvoiceAsk, - commission_reporting.Agent, - commission_reporting.AgentTimeseries, - commission_reporting.Context, - invoice.Invoice, - invoice.InvoiceLine, - invoice.CreditInvoiceStart, - product.Template, - product.Template_Agent, - product.Product, - account.Journal, - party.Party, - ir.EmailTemplate, - module='commission', type_='model') - Pool.register( - sale.Sale, - sale.Line, - module='commission', type_='model', - depends=['sale']) - Pool.register( - stock.Move, - stock_reporting_margin.Context, - module='commission', type_='model', - depends=['stock']) - Pool.register( - commission.CreateInvoice, - invoice.CreditInvoice, - party.Replace, - party.Erase, - module='commission', type_='wizard') - if StockReportingMarginAbstract: - Pool.register_mixin( - stock_reporting_margin.AbstractCommissionMixin, - StockReportingMarginAbstract, - module='commission') diff --git a/modules/commission/tryton.cfg b/modules/commission/tryton.cfg index 18873a51dd..80b73face3 100644 --- a/modules/commission/tryton.cfg +++ b/modules/commission/tryton.cfg @@ -24,3 +24,42 @@ xml: message.xml party.xml stock_reporting_margin.xml + +[register] +model: + ir.EmailTemplate + party.Party + product.Template + product.Template_Agent + product.Product + commission.Plan + commission.PlanLines + commission.Agent + commission.AgentSelection + commission.Commission + commission.CreateInvoiceAsk + commission_reporting.Agent + commission_reporting.AgentTimeseries + commission_reporting.Context + account.Journal + invoice.Invoice + invoice.InvoiceLine + invoice.CreditInvoiceStart +wizard: + commission.CreateInvoice + invoice.CreditInvoice + party.Replace + party.Erase + +[register sale] +model: + sale.Sale + sale.Line + +[register stock] +model: + stock.Move + stock_reporting_margin.Context + +[register_mixin] +stock_reporting_margin.AbstractCommissionMixin: trytond.modules.stock.stock_reporting_margin.Abstract diff --git a/modules/commission_waiting/__init__.py b/modules/commission_waiting/__init__.py index 6cdb616741..4effdfa4a2 100644 --- a/modules/commission_waiting/__init__.py +++ b/modules/commission_waiting/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, commission, invoice - - -def register(): - Pool.register( - commission.Agent, - commission.Commission, - invoice.Invoice, - invoice.InvoiceLine, - account.Move, - module='commission_waiting', type_='model') diff --git a/modules/commission_waiting/tryton.cfg b/modules/commission_waiting/tryton.cfg index d81fd2c8b0..e0fcde8b2d 100644 --- a/modules/commission_waiting/tryton.cfg +++ b/modules/commission_waiting/tryton.cfg @@ -7,3 +7,11 @@ depends: ir xml: commission.xml + +[register] +model: + commission.Agent + commission.Commission + invoice.Invoice + invoice.InvoiceLine + account.Move diff --git a/modules/company/__init__.py b/modules/company/__init__.py index 46ce2d0111..616c71700b 100644 --- a/modules/company/__init__.py +++ b/modules/company/__init__.py @@ -1,43 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import company, ir, party, res -from .company import CompanyReport - -__all__ = ['register', 'CompanyReport'] +__all__ = ['CompanyReport'] -def register(): - Pool.register( - company.Company, - company.CompanyTaxIdentifier, - company.CompanyLogoCache, - company.Employee, - company.CompanyConfigStart, - res.UserCompany, - res.UserEmployee, - res.User, - ir.Sequence, - ir.SequenceStrict, - ir.Date, - ir.Rule, - ir.Cron, - ir.CronCompany, - ir.EmailTemplate, - party.Configuration, - party.ConfigurationLang, - party.Party, - party.PartyLang, - party.ContactMechanism, - party.ContactMechanismLanguage, - module='company', type_='model') - Pool.register( - company.CompanyConfig, - party.Replace, - party.Erase, - module='company', type_='wizard') - Pool.register( - party.LetterReport, - module='company', type_='report') +def __getattr__(name): + if name == 'CompanyReport': + from .company import CompanyReport + return CompanyReport + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/company/tryton.cfg b/modules/company/tryton.cfg index e7a062ef92..deb927acb4 100644 --- a/modules/company/tryton.cfg +++ b/modules/company/tryton.cfg @@ -9,3 +9,33 @@ xml: company.xml ir.xml message.xml + +[register] +model: + ir.Sequence + ir.SequenceStrict + ir.Date + ir.Rule + ir.Cron + ir.CronCompany + ir.EmailTemplate + party.Configuration + party.ConfigurationLang + party.Party + party.PartyLang + party.ContactMechanism + party.ContactMechanismLanguage + company.Company + company.CompanyTaxIdentifier + company.CompanyLogoCache + company.Employee + company.CompanyConfigStart + res.User + res.UserCompany + res.UserEmployee +wizard: + party.Replace + party.Erase + company.CompanyConfig +report: + party.LetterReport diff --git a/modules/company_work_time/__init__.py b/modules/company_work_time/__init__.py index 0d3997d69a..4effdfa4a2 100644 --- a/modules/company_work_time/__init__.py +++ b/modules/company_work_time/__init__.py @@ -1,13 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import company, res - - -def register(): - Pool.register( - company.Company, - res.User, - module='company_work_time', type_='model') diff --git a/modules/company_work_time/tryton.cfg b/modules/company_work_time/tryton.cfg index 0b34e3f7fe..5e63c47cd8 100644 --- a/modules/company_work_time/tryton.cfg +++ b/modules/company_work_time/tryton.cfg @@ -5,3 +5,8 @@ depends: ir xml: company.xml + +[register] +model: + res.User + company.Company diff --git a/modules/country/__init__.py b/modules/country/__init__.py index dcc3549d5f..4effdfa4a2 100644 --- a/modules/country/__init__.py +++ b/modules/country/__init__.py @@ -1,17 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - - -def register(): - # Prevent to import backend when importing scripts - from . import country - Pool.register( - country.Organization, - country.OrganizationMember, - country.Region, - country.Country, - country.Subdivision, - country.PostalCode, - module='country', type_='model') diff --git a/modules/country/tryton.cfg b/modules/country/tryton.cfg index 075205be8a..59770df25a 100644 --- a/modules/country/tryton.cfg +++ b/modules/country/tryton.cfg @@ -7,3 +7,12 @@ xml: country.xml organization.xml region.xml + +[register] +model: + country.Organization + country.OrganizationMember + country.Region + country.Country + country.Subdivision + country.PostalCode diff --git a/modules/currency/__init__.py b/modules/currency/__init__.py index 893f645391..4effdfa4a2 100644 --- a/modules/currency/__init__.py +++ b/modules/currency/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - - -def register(): - # Prevent to import backend when importing scripts - from . import currency, ir - Pool.register( - currency.Currency, - currency.CurrencyRate, - currency.Cron, - currency.Cron_Currency, - ir.Cron, - module='currency', type_='model') diff --git a/modules/currency/tryton.cfg b/modules/currency/tryton.cfg index ec353c7d08..a8b8b11251 100644 --- a/modules/currency/tryton.cfg +++ b/modules/currency/tryton.cfg @@ -6,3 +6,11 @@ depends: xml: currency.xml message.xml + +[register] +model: + ir.Cron + currency.Currency + currency.CurrencyRate + currency.Cron + currency.Cron_Currency diff --git a/modules/currency_ro/__init__.py b/modules/currency_ro/__init__.py index 78a8567a9a..4effdfa4a2 100644 --- a/modules/currency_ro/__init__.py +++ b/modules/currency_ro/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import currency - -__all__ = ['register'] - - -def register(): - Pool.register( - currency.Cron, - module='currency_ro', type_='model') diff --git a/modules/currency_ro/tryton.cfg b/modules/currency_ro/tryton.cfg index deccdda200..e0401818f7 100644 --- a/modules/currency_ro/tryton.cfg +++ b/modules/currency_ro/tryton.cfg @@ -3,3 +3,7 @@ version=7.7.0 depends: currency ir + +[register] +model: + currency.Cron diff --git a/modules/currency_rs/__init__.py b/modules/currency_rs/__init__.py index 06ce1e5fe8..4effdfa4a2 100644 --- a/modules/currency_rs/__init__.py +++ b/modules/currency_rs/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import currency - -__all__ = ['register'] - - -def register(): - Pool.register( - currency.Cron, - module='currency_rs', type_='model') diff --git a/modules/currency_rs/tryton.cfg b/modules/currency_rs/tryton.cfg index 72c6ef0d8c..3cce74d4fc 100644 --- a/modules/currency_rs/tryton.cfg +++ b/modules/currency_rs/tryton.cfg @@ -5,3 +5,7 @@ depends: ir xml: currency.xml + +[register] +model: + currency.Cron diff --git a/modules/customs/__init__.py b/modules/customs/__init__.py index a898f08596..4effdfa4a2 100644 --- a/modules/customs/__init__.py +++ b/modules/customs/__init__.py @@ -1,17 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import customs, product - - -def register(): - Pool.register( - customs.TariffCode, - customs.DutyRate, - product.Category, - product.Template, - product.Product_TariffCode, - product.Product, - module='customs', type_='model') diff --git a/modules/customs/tryton.cfg b/modules/customs/tryton.cfg index a309b8293a..a83f9cac4b 100644 --- a/modules/customs/tryton.cfg +++ b/modules/customs/tryton.cfg @@ -9,3 +9,12 @@ depends: xml: customs.xml product.xml + +[register] +model: + customs.TariffCode + customs.DutyRate + product.Category + product.Template + product.Product_TariffCode + product.Product diff --git a/modules/dashboard/__init__.py b/modules/dashboard/__init__.py index 6bec144344..4effdfa4a2 100644 --- a/modules/dashboard/__init__.py +++ b/modules/dashboard/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import dashboard, ir, res - - -def register(): - Pool.register( - dashboard.Action, - res.User, - ir.View, - module='dashboard', type_='model') diff --git a/modules/dashboard/tryton.cfg b/modules/dashboard/tryton.cfg index 1fbba85b1a..57fcace3c6 100644 --- a/modules/dashboard/tryton.cfg +++ b/modules/dashboard/tryton.cfg @@ -7,3 +7,9 @@ xml: dashboard.xml res.xml ir.xml + +[register] +model: + ir.View + res.User + dashboard.Action diff --git a/modules/document_incoming/__init__.py b/modules/document_incoming/__init__.py index 15e596dd9d..aed6e0e6c7 100644 --- a/modules/document_incoming/__init__.py +++ b/modules/document_incoming/__init__.py @@ -1,23 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool +from . import routes -from . import document, inbound_email, res, routes - -__all__ = ['register', 'routes'] - - -def register(): - Pool.register( - res.UserApplication, - document.IncomingConfiguration, - document.Incoming, - document.IncomingSplitStart, - module='document_incoming', type_='model') - Pool.register( - document.IncomingSplit, - module='document_incoming', type_='wizard') - Pool.register( - inbound_email.Rule, - module='document_incoming', type_='model', depends=['inbound_email']) +__all__ = [routes] diff --git a/modules/document_incoming/tryton.cfg b/modules/document_incoming/tryton.cfg index 5141c3a480..294f3ceef9 100644 --- a/modules/document_incoming/tryton.cfg +++ b/modules/document_incoming/tryton.cfg @@ -10,3 +10,16 @@ xml: document.xml inbound_email.xml message.xml + +[register] +model: + res.UserApplication + document.IncomingConfiguration + document.Incoming + document.IncomingSplitStart +wizard: + document.IncomingSplit + +[register inbound_email] +model: + inbound_email.Rule diff --git a/modules/document_incoming_invoice/__init__.py b/modules/document_incoming_invoice/__init__.py index 29f5d305b7..4effdfa4a2 100644 --- a/modules/document_incoming_invoice/__init__.py +++ b/modules/document_incoming_invoice/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, document - -__all__ = ['register'] - - -def register(): - Pool.register( - account.Invoice, - document.IncomingConfiguration, - document.Incoming, - module='document_incoming_invoice', type_='model') diff --git a/modules/document_incoming_invoice/tryton.cfg b/modules/document_incoming_invoice/tryton.cfg index 3efa30fdad..e2bf69bd1f 100644 --- a/modules/document_incoming_invoice/tryton.cfg +++ b/modules/document_incoming_invoice/tryton.cfg @@ -8,3 +8,9 @@ depends: xml: document.xml message.xml + +[register] +model: + account.Invoice + document.IncomingConfiguration + document.Incoming diff --git a/modules/document_incoming_ocr/__init__.py b/modules/document_incoming_ocr/__init__.py index 22704f1600..4effdfa4a2 100644 --- a/modules/document_incoming_ocr/__init__.py +++ b/modules/document_incoming_ocr/__init__.py @@ -1,26 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, document - -__all__ = ['register'] - - -def register(): - Pool.register( - document.Incoming, - document.IncomingOCRService, - module='document_incoming_ocr', type_='model') - Pool.register( - account.Invoice, - document.IncomingSupplierInvoice, - module='document_incoming_ocr', type_='model', - depends=[ - 'account_invoice', 'account_product', 'document_incoming_invoice', - 'product']) - Pool.register( - document.IncomingSupplierInvoicePurchase, - module='document_incoming_ocr', type_='model', - depends=['purchase']) diff --git a/modules/document_incoming_ocr/tryton.cfg b/modules/document_incoming_ocr/tryton.cfg index c5fd371bad..e77cc991cc 100644 --- a/modules/document_incoming_ocr/tryton.cfg +++ b/modules/document_incoming_ocr/tryton.cfg @@ -12,3 +12,17 @@ extras_depend: purchase xml: document.xml + +[register] +model: + document.Incoming + document.IncomingOCRService + +[register account_invoice account_product document_incoming_invoice product] +model: + account.Invoice + document.IncomingSupplierInvoice + +[register purchase] +model: + document.IncomingSupplierInvoicePurchase diff --git a/modules/document_incoming_ocr_typless/__init__.py b/modules/document_incoming_ocr_typless/__init__.py index bfe4c27171..4effdfa4a2 100644 --- a/modules/document_incoming_ocr_typless/__init__.py +++ b/modules/document_incoming_ocr_typless/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import document - -__all__ = ['register'] - - -def register(): - Pool.register( - document.IncomingOCRService, - module='document_incoming_ocr_typless', type_='model') diff --git a/modules/document_incoming_ocr_typless/tryton.cfg b/modules/document_incoming_ocr_typless/tryton.cfg index 30b7411604..588611e974 100644 --- a/modules/document_incoming_ocr_typless/tryton.cfg +++ b/modules/document_incoming_ocr_typless/tryton.cfg @@ -11,3 +11,7 @@ extras_depend: xml: document.xml message.xml + +[register] +model: + document.IncomingOCRService diff --git a/modules/edocument_uncefact/__init__.py b/modules/edocument_uncefact/__init__.py index 45672c8c51..4effdfa4a2 100644 --- a/modules/edocument_uncefact/__init__.py +++ b/modules/edocument_uncefact/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import edocument - -__all__ = ['register'] - - -def register(): - Pool.register( - edocument.Invoice, - module='edocument_uncefact', type_='model') diff --git a/modules/edocument_uncefact/tryton.cfg b/modules/edocument_uncefact/tryton.cfg index 8e6fd8005d..879c3763ca 100644 --- a/modules/edocument_uncefact/tryton.cfg +++ b/modules/edocument_uncefact/tryton.cfg @@ -5,4 +5,7 @@ depends: edocument_unece extras_depend: account_invoice -xml: + +[register] +model: + edocument.Invoice diff --git a/modules/edocument_unece/__init__.py b/modules/edocument_unece/__init__.py index 1f11d00e72..4effdfa4a2 100644 --- a/modules/edocument_unece/__init__.py +++ b/modules/edocument_unece/__init__.py @@ -1,20 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, product - -__all__ = ['register'] - - -def register(): - Pool.register( - product.Uom, - account.TaxTemplate, - account.Tax, - module='edocument_unece', type_='model') - Pool.register( - module='edocument_unece', type_='wizard') - Pool.register( - module='edocument_unece', type_='report') diff --git a/modules/edocument_unece/tryton.cfg b/modules/edocument_unece/tryton.cfg index 8081baa78f..6dc5be5493 100644 --- a/modules/edocument_unece/tryton.cfg +++ b/modules/edocument_unece/tryton.cfg @@ -7,3 +7,10 @@ depends: xml: product.xml account.xml + +[register] +model: + product.Uom + account.TaxTemplate + account.Tax + diff --git a/modules/google_maps/__init__.py b/modules/google_maps/__init__.py index e30659fadc..4effdfa4a2 100644 --- a/modules/google_maps/__init__.py +++ b/modules/google_maps/__init__.py @@ -1,12 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import address - - -def register(): - Pool.register( - address.Address, - module='google_maps', type_='model') diff --git a/modules/google_maps/tryton.cfg b/modules/google_maps/tryton.cfg index 3f2b4f4a79..30cb318110 100644 --- a/modules/google_maps/tryton.cfg +++ b/modules/google_maps/tryton.cfg @@ -5,3 +5,7 @@ depends: party xml: address.xml + +[register] +model: + address.Address diff --git a/modules/inbound_email/__init__.py b/modules/inbound_email/__init__.py index caeed865c2..aed6e0e6c7 100644 --- a/modules/inbound_email/__init__.py +++ b/modules/inbound_email/__init__.py @@ -1,17 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool +from . import routes -from . import inbound_email, routes - -__all__ = ['register', 'routes'] - - -def register(): - Pool.register( - inbound_email.Inbox, - inbound_email.Email, - inbound_email.Rule, - inbound_email.RuleHeader, - module='inbound_email', type_='model') +__all__ = [routes] diff --git a/modules/inbound_email/tryton.cfg b/modules/inbound_email/tryton.cfg index 05c3d76c44..a08293bc9f 100644 --- a/modules/inbound_email/tryton.cfg +++ b/modules/inbound_email/tryton.cfg @@ -5,3 +5,10 @@ depends: res xml: inbound_email.xml + +[register] +model: + inbound_email.Inbox + inbound_email.Email + inbound_email.Rule + inbound_email.RuleHeader diff --git a/modules/incoterm/__init__.py b/modules/incoterm/__init__.py index 714a58ba29..4effdfa4a2 100644 --- a/modules/incoterm/__init__.py +++ b/modules/incoterm/__init__.py @@ -1,55 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, carrier, company, incoterm, party, purchase, sale, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - incoterm.Incoterm, - incoterm.Incoterm_Company, - company.Company, - party.Party, - party.Address, - party.Incoterm, - module='incoterm', type_='model') - Pool.register( - carrier.Carrier, - module='incoterm', type_='model', depends=['carrier']) - Pool.register( - sale.Sale, - stock.ShipmentOut_Sale, - module='incoterm', type_='model', depends=['sale']) - Pool.register( - sale.Sale_Carrier, - module='incoterm', type_='model', depends=['sale_shipment_cost']) - Pool.register( - sale.Opportunity, - module='incoterm', type_='model', depends=['sale_opportunity']) - Pool.register( - purchase.Purchase, - stock.ShipmentIn_Purchase, - module='incoterm', type_='model', depends=['purchase']) - Pool.register( - purchase.RequestQuotation, - module='incoterm', type_='model', - depends=['purchase_request_quotation']) - Pool.register( - purchase.RequestCreatePurchase, - module='incoterm', type_='wizard', - depends=['purchase_request_quotation']) - Pool.register( - stock.ShipmentIn, - stock.ShipmentInReturn, - stock.ShipmentOut, - stock.ShipmentOutReturn, - module='incoterm', type_='model', depends=['stock']) - Pool.register( - account.Invoice, - account.InvoiceLine, - module='incoterm', type_='model', - depends=['account_invoice', 'account_invoice_stock']) diff --git a/modules/incoterm/tryton.cfg b/modules/incoterm/tryton.cfg index 6ebbf0b7d4..0524dc8ff2 100644 --- a/modules/incoterm/tryton.cfg +++ b/modules/incoterm/tryton.cfg @@ -26,3 +26,52 @@ xml: sale.xml stock.xml message.xml + +[register] +model: + incoterm.Incoterm + incoterm.Incoterm_Company + party.Party + party.Address + party.Incoterm + company.Company + +[register account_invoice account_invoice_stock] +model: + account.Invoice + account.InvoiceLine + +[register carrier] +model: + carrier.Carrier + +[register purchase] +model: + purchase.Purchase + stock.ShipmentIn_Purchase + +[register purchase_request_quotation] +model: + purchase.RequestQuotation +wizard: + purchase.RequestCreatePurchase + +[register sale] +model: + sale.Sale + stock.ShipmentOut_Sale + +[register sale_opportunity] +model: + sale.Opportunity + +[register sale_shipment_cost] +model: + sale.Sale_Carrier + +[register stock] +model: + stock.ShipmentIn + stock.ShipmentInReturn + stock.ShipmentOut + stock.ShipmentOutReturn diff --git a/modules/ldap_authentication/__init__.py b/modules/ldap_authentication/__init__.py index 146341574d..4effdfa4a2 100644 --- a/modules/ldap_authentication/__init__.py +++ b/modules/ldap_authentication/__init__.py @@ -1,12 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import res - - -def register(): - Pool.register( - res.User, - module='ldap_authentication', type_='model') diff --git a/modules/ldap_authentication/tryton.cfg b/modules/ldap_authentication/tryton.cfg index 11e5f19512..d16ca2a602 100644 --- a/modules/ldap_authentication/tryton.cfg +++ b/modules/ldap_authentication/tryton.cfg @@ -5,3 +5,7 @@ depends: res xml: message.xml + +[register] +model: + res.User diff --git a/modules/marketing/__init__.py b/modules/marketing/__init__.py index 221bb3273d..4effdfa4a2 100644 --- a/modules/marketing/__init__.py +++ b/modules/marketing/__init__.py @@ -1,15 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -__all__ = ['register'] - - -def register(): - Pool.register( - module='marketing', type_='model') - Pool.register( - module='marketing', type_='wizard') - Pool.register( - module='marketing', type_='report') diff --git a/modules/marketing_automation/__init__.py b/modules/marketing_automation/__init__.py index a29a11472f..9816b2ea99 100644 --- a/modules/marketing_automation/__init__.py +++ b/modules/marketing_automation/__init__.py @@ -1,34 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool -from . import ( - ir, marketing_automation, marketing_automation_reporting, party, routes, - sale, web) +from . import routes -__all__ = ['register', 'routes'] - - -def register(): - Pool.register( - ir.Cron, - ir.Email, - marketing_automation.Scenario, - marketing_automation.Activity, - marketing_automation.Record, - marketing_automation.RecordActivity, - marketing_automation_reporting.Context, - marketing_automation_reporting.Scenario, - marketing_automation_reporting.Activity, - party.Party, - party.PartyUnsubscribedScenario, - web.ShortenedURL, - module='marketing_automation', type_='model') - Pool.register( - sale.Sale, - module='marketing_automation', type_='model', - depends=['sale']) - Pool.register( - marketing_automation.Unsubscribe, - module='marketing_automation', type_='report') +__all__ = [routes] diff --git a/modules/marketing_automation/tryton.cfg b/modules/marketing_automation/tryton.cfg index 935f216201..b1e68bb49d 100644 --- a/modules/marketing_automation/tryton.cfg +++ b/modules/marketing_automation/tryton.cfg @@ -14,3 +14,24 @@ xml: marketing_automation_reporting.xml party.xml message.xml + +[register] +model: + ir.Cron + ir.Email + marketing_automation.Scenario + marketing_automation.Activity + marketing_automation.Record + marketing_automation.RecordActivity + marketing_automation_reporting.Context + marketing_automation_reporting.Scenario + marketing_automation_reporting.Activity + party.Party + party.PartyUnsubscribedScenario + web.ShortenedURL +report: + marketing_automation.Unsubscribe + +[register sale] +model: + sale.Sale diff --git a/modules/marketing_campaign/__init__.py b/modules/marketing_campaign/__init__.py index 7f7aa4be1a..c3a3e942dc 100644 --- a/modules/marketing_campaign/__init__.py +++ b/modules/marketing_campaign/__init__.py @@ -1,65 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -try: - from trytond.modules.sale.sale_reporting import Abstract as SaleAbstract -except ImportError: - SaleAbstract = None -try: - from trytond.modules.sale_opportunity.opportunity_reporting import \ - Abstract as OpportunityAbstract -except ImportError: - OpportunityAbstract = None - -from . import marketing, sale, sale_opportunity_reporting, sale_reporting, web -from .marketing import MarketingCampaignMixin, MarketingCampaignUTM, Parameter - -__all__ = [ - 'register', 'Parameter', 'MarketingCampaignMixin', 'MarketingCampaignUTM'] +__all__ = ['Parameter', 'MarketingCampaignMixin', 'MarketingCampaignUTM'] -def register(): - Pool.register( - marketing.Campaign, - marketing.Medium, - marketing.Source, - module='marketing_campaign', type_='model') - Pool.register( - sale.Sale, - sale_reporting.Context, - sale_reporting.MarketingContext, - sale_reporting.Marketing, - module='marketing_campaign', type_='model', depends=['sale']) - Pool.register( - sale.Opportunity, - sale_opportunity_reporting.Context, - sale_opportunity_reporting.MarketingContext, - sale_opportunity_reporting.Marketing, - module='marketing_campaign', type_='model', - depends=['sale_opportunity']) - Pool.register( - sale.POSSale, - module='marketing_campaign', type_='model', depends=['sale_point']) - Pool.register( - web.ShortenedURL, - module='marketing_campaign', type_='model', depends=['web_shortener']) - Pool.register( - marketing.EmailMessage, - module='marketing_campaign', type_='model', - depends=['marketing_email']) - Pool.register( - marketing.AutomationActivity, - marketing.AutomationRecordActivity, - module='marketing_campaign', type_='model', - depends=['marketing_automation']) - if SaleAbstract: - Pool.register_mixin( - sale_reporting.AbstractMarketingCampaign, SaleAbstract, - module='marketing_campaign') - if OpportunityAbstract: - Pool.register_mixin( - sale_opportunity_reporting.AbstractMarketingCampaign, - OpportunityAbstract, - module='marketing_campaign') +def __getattr__(name): + if name in {'Parameter', 'MarketingCampaignMixin', 'MarketingCampaignUTM'}: + from . import marketing + return getattr(marketing, name) + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/marketing_campaign/tryton.cfg b/modules/marketing_campaign/tryton.cfg index 968d9590e0..e8f73e3834 100644 --- a/modules/marketing_campaign/tryton.cfg +++ b/modules/marketing_campaign/tryton.cfg @@ -16,3 +16,44 @@ xml: sale_reporting.xml sale_opportunity_reporting.xml message.xml + +[register] +model: + marketing.Campaign + marketing.Medium + marketing.Source + +[register_mixin] +sale_reporting.AbstractMarketingCampaign: trytond.modules.sale.sale_reporting.Abstract +sale_opportunity_reporting.AbstractMarketingCampaign: trytond.modules.sale_opportunity.opportunity_reporting.Abstract + +[register marketing_automation] +model: + marketing.AutomationActivity + marketing.AutomationRecordActivity + +[register marketing_email] +model: + marketing.EmailMessage + +[register sale] +model: + sale.Sale + sale_reporting.Context + sale_reporting.MarketingContext + sale_reporting.Marketing + +[register sale_opportunity] +model: + sale.Opportunity + sale_opportunity_reporting.Context + sale_opportunity_reporting.MarketingContext + sale_opportunity_reporting.Marketing + +[register sale_point] +model: + sale.POSSale + +[register web_shortener] +model: + web.ShortenedURL diff --git a/modules/marketing_email/__init__.py b/modules/marketing_email/__init__.py index 1a4d7fee42..aed6e0e6c7 100644 --- a/modules/marketing_email/__init__.py +++ b/modules/marketing_email/__init__.py @@ -1,26 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool +from . import routes -from . import ir, marketing, routes, web - -__all__ = ['register', 'routes'] - - -def register(): - Pool.register( - marketing.Email, - marketing.EmailList, - marketing.Message, - marketing.SendTestView, - ir.Cron, - web.ShortenedURL, - module='marketing_email', type_='model') - Pool.register( - marketing.SendTest, - module='marketing_email', type_='wizard') - Pool.register( - marketing.EmailSubscribe, - marketing.EmailUnsubscribe, - module='marketing_email', type_='report') +__all__ = [routes] diff --git a/modules/marketing_email/tryton.cfg b/modules/marketing_email/tryton.cfg index 581c9e0c7a..f9aa33eb6f 100644 --- a/modules/marketing_email/tryton.cfg +++ b/modules/marketing_email/tryton.cfg @@ -10,3 +10,17 @@ depends: xml: marketing.xml message.xml + +[register] +model: + marketing.Email + marketing.EmailList + marketing.Message + marketing.SendTestView + ir.Cron + web.ShortenedURL +wizard: + marketing.SendTest +report: + marketing.EmailSubscribe + marketing.EmailUnsubscribe diff --git a/modules/notification_email/__init__.py b/modules/notification_email/__init__.py index c0477d4c2f..4effdfa4a2 100644 --- a/modules/notification_email/__init__.py +++ b/modules/notification_email/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import ir, notification - - -def register(): - Pool.register( - ir.Trigger, - ir.Email, - notification.Email, - notification.EmailAttachment, - module='notification_email', type_='model') diff --git a/modules/notification_email/tryton.cfg b/modules/notification_email/tryton.cfg index 30de274cf1..7cc0fd6b37 100644 --- a/modules/notification_email/tryton.cfg +++ b/modules/notification_email/tryton.cfg @@ -12,3 +12,10 @@ xml: notification.xml ir.xml message.xml + +[register] +model: + ir.Trigger + ir.Email + notification.Email + notification.EmailAttachment diff --git a/modules/party/__init__.py b/modules/party/__init__.py index 2427cf5224..4effdfa4a2 100644 --- a/modules/party/__init__.py +++ b/modules/party/__init__.py @@ -1,36 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import ( - address, category, configuration, contact_mechanism, country, ir, party) - - -def register(): - Pool.register( - country.PostalCode, - category.Category, - party.Party, - party.PartyLang, - party.PartyCategory, - party.Identifier, - party.CheckVIESResult, - party.ReplaceAsk, - party.EraseAsk, - address.Address, - address.AddressFormat, - address.SubdivisionType, - contact_mechanism.ContactMechanism, - contact_mechanism.ContactMechanismLanguage, - configuration.Configuration, - configuration.ConfigurationSequence, - configuration.ConfigurationLang, - ir.Email, - ir.EmailTemplate, - module='party', type_='model') - Pool.register( - party.CheckVIES, - party.Replace, - party.Erase, - module='party', type_='wizard') diff --git a/modules/party/tryton.cfg b/modules/party/tryton.cfg index 09d53a9415..973c9f9e29 100644 --- a/modules/party/tryton.cfg +++ b/modules/party/tryton.cfg @@ -12,3 +12,29 @@ xml: configuration.xml ir.xml message.xml + +[register] +model: + country.PostalCode + category.Category + party.Party + party.PartyLang + party.PartyCategory + party.Identifier + party.CheckVIESResult + party.ReplaceAsk + party.EraseAsk + address.Address + address.AddressFormat + address.SubdivisionType + contact_mechanism.ContactMechanism + contact_mechanism.ContactMechanismLanguage + configuration.Configuration + configuration.ConfigurationSequence + configuration.ConfigurationLang + ir.Email + ir.EmailTemplate +wizard: + party.CheckVIES + party.Replace + party.Erase diff --git a/modules/party_avatar/__init__.py b/modules/party_avatar/__init__.py index 38aa3a9238..4effdfa4a2 100644 --- a/modules/party_avatar/__init__.py +++ b/modules/party_avatar/__init__.py @@ -1,19 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import company, party, res - -__all__ = ['register'] - - -def register(): - Pool.register( - party.Party, - module='party_avatar', type_='model') - Pool.register( - company.Company, - company.Employee, - res.User, - module='party_avatar', type_='model', depends=['company']) diff --git a/modules/party_avatar/tryton.cfg b/modules/party_avatar/tryton.cfg index 483695d5b5..cfda45e869 100644 --- a/modules/party_avatar/tryton.cfg +++ b/modules/party_avatar/tryton.cfg @@ -9,3 +9,13 @@ extras_depend: xml: party.xml company.xml + +[register] +model: + party.Party + +[register company] +model: + company.Company + company.Employee + res.User diff --git a/modules/party_relationship/__init__.py b/modules/party_relationship/__init__.py index 3f1be1d44b..4effdfa4a2 100644 --- a/modules/party_relationship/__init__.py +++ b/modules/party_relationship/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import party - - -def register(): - Pool.register( - party.RelationType, - party.Relation, - party.RelationAll, - party.Party, - module='party_relationship', type_='model') diff --git a/modules/party_relationship/tryton.cfg b/modules/party_relationship/tryton.cfg index 18affa45bc..aaefe32c7c 100644 --- a/modules/party_relationship/tryton.cfg +++ b/modules/party_relationship/tryton.cfg @@ -4,3 +4,10 @@ depends: party xml: party.xml + +[register] +model: + party.RelationType + party.Relation + party.RelationAll + party.Party diff --git a/modules/party_siret/__init__.py b/modules/party_siret/__init__.py index d389b3fadd..4effdfa4a2 100644 --- a/modules/party_siret/__init__.py +++ b/modules/party_siret/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import address, company, party - - -def register(): - Pool.register( - party.Party, - address.Address, - module='party_siret', type_='model') - Pool.register( - company.Company, - module='party_siret', type_='model', depends=['company']) diff --git a/modules/party_siret/tryton.cfg b/modules/party_siret/tryton.cfg index b6b771f153..6c37286bcd 100644 --- a/modules/party_siret/tryton.cfg +++ b/modules/party_siret/tryton.cfg @@ -8,3 +8,12 @@ extras_depend: xml: party.xml address.xml + +[register] +model: + party.Party + address.Address + +[register company] +model: + company.Company diff --git a/modules/product/__init__.py b/modules/product/__init__.py index 679b7f5230..e554d88192 100644 --- a/modules/product/__init__.py +++ b/modules/product/__init__.py @@ -1,38 +1,18 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import category, configuration, ir, product, uom -from .product import ( - ProductDeactivatableMixin, TemplateDeactivatableMixin, price_digits, - round_price) -from .uom import uom_conversion_digits - -__all__ = [price_digits, round_price, uom_conversion_digits, - ProductDeactivatableMixin, TemplateDeactivatableMixin] +__all__ = [ + 'price_digits', 'round_price', 'uom_conversion_digits', + 'ProductDeactivatableMixin', 'TemplateDeactivatableMixin'] -def register(): - Pool.register( - ir.Configuration, - ir.Cron, - uom.UomCategory, - uom.Uom, - category.Category, - product.Template, - product.Product, - product.ProductIdentifier, - product.ProductListPrice, - # before ProductCostPrice for migration - product.ProductCostPriceMethod, - product.ProductCostPrice, - product.TemplateCategory, - product.TemplateCategoryAll, - product.ProductReplaceAsk, - configuration.Configuration, - configuration.ConfigurationDefaultCostPriceMethod, - module='product', type_='model') - Pool.register( - product.ProductReplace, - module='product', type_='wizard') +def __getattr__(name): + if name == 'uom_conversion_digits': + from .uom import uom_conversion_digits + return uom_conversion_digits + elif name in { + 'price_digits', 'round_price', + 'ProductDeactivatableMixin', 'TemplateDeactivatableMixin'}: + from . import product + return getattr(product, name) + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/product/tryton.cfg b/modules/product/tryton.cfg index a6deeaf970..98717e83f9 100644 --- a/modules/product/tryton.cfg +++ b/modules/product/tryton.cfg @@ -10,3 +10,25 @@ xml: uom.xml configuration.xml message.xml + +[register] +model: + ir.Configuration + ir.Cron + uom.UomCategory + uom.Uom + category.Category + product.Template + product.Product + product.ProductIdentifier + product.ProductListPrice + # before ProductCostPrice for migration + product.ProductCostPriceMethod + product.ProductCostPrice + product.TemplateCategory + product.TemplateCategoryAll + product.ProductReplaceAsk + configuration.Configuration + configuration.ConfigurationDefaultCostPriceMethod +wizard: + product.ProductReplace diff --git a/modules/product_attribute/__init__.py b/modules/product_attribute/__init__.py index c3b6857434..4effdfa4a2 100644 --- a/modules/product_attribute/__init__.py +++ b/modules/product_attribute/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product - - -def register(): - Pool.register( - product.AttributeSet, - product.Attribute, - product.AttributeAttributeSet, - product.Template, - product.Product, - module='product_attribute', type_='model') diff --git a/modules/product_attribute/tryton.cfg b/modules/product_attribute/tryton.cfg index 5c6d029bb7..7178f41472 100644 --- a/modules/product_attribute/tryton.cfg +++ b/modules/product_attribute/tryton.cfg @@ -6,3 +6,11 @@ depends: xml: product.xml message.xml + +[register] +model: + product.AttributeSet + product.Attribute + product.AttributeAttributeSet + product.Template + product.Product diff --git a/modules/product_classification/__init__.py b/modules/product_classification/__init__.py index 745e5ea581..4effdfa4a2 100644 --- a/modules/product_classification/__init__.py +++ b/modules/product_classification/__init__.py @@ -1,15 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product - - -def register(): - Pool.register( - product.Template, - product.Product, - product.ClassificationDummy, - product.ClassificationTreeDummy, - module='product_classification', type_='model') diff --git a/modules/product_classification/tryton.cfg b/modules/product_classification/tryton.cfg index e9a30b6df7..4e57114679 100644 --- a/modules/product_classification/tryton.cfg +++ b/modules/product_classification/tryton.cfg @@ -5,3 +5,10 @@ depends: product xml: product.xml + +[register] +model: + product.Template + product.Product + product.ClassificationDummy + product.ClassificationTreeDummy diff --git a/modules/product_classification_taxonomic/__init__.py b/modules/product_classification_taxonomic/__init__.py index 120dbfb00d..4effdfa4a2 100644 --- a/modules/product_classification_taxonomic/__init__.py +++ b/modules/product_classification_taxonomic/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product - - -def register(): - Pool.register( - product.Template, - product.Taxon, - product.Cultivar, - product.CultivarGroup, - product.Cultivar_CultivarGroup, - module='product_classification_taxonomic', type_='model') diff --git a/modules/product_classification_taxonomic/tryton.cfg b/modules/product_classification_taxonomic/tryton.cfg index 79e5a43923..bbd4ee8151 100644 --- a/modules/product_classification_taxonomic/tryton.cfg +++ b/modules/product_classification_taxonomic/tryton.cfg @@ -5,3 +5,11 @@ depends: product_classification xml: product.xml + +[register] +model: + product.Template + product.Taxon + product.Cultivar + product.CultivarGroup + product.Cultivar_CultivarGroup diff --git a/modules/product_cost_fifo/__init__.py b/modules/product_cost_fifo/__init__.py index b951d4e73a..4effdfa4a2 100644 --- a/modules/product_cost_fifo/__init__.py +++ b/modules/product_cost_fifo/__init__.py @@ -1,13 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import move, product - - -def register(): - Pool.register( - product.Template, - product.Product, - move.Move, - module='product_cost_fifo', type_='model') diff --git a/modules/product_cost_fifo/tryton.cfg b/modules/product_cost_fifo/tryton.cfg index 52eafb1b91..d24e9fde30 100644 --- a/modules/product_cost_fifo/tryton.cfg +++ b/modules/product_cost_fifo/tryton.cfg @@ -6,3 +6,9 @@ depends: stock xml: message.xml + +[register] +model: + product.Template + product.Product + move.Move diff --git a/modules/product_cost_history/__init__.py b/modules/product_cost_history/__init__.py index ab170db61b..4effdfa4a2 100644 --- a/modules/product_cost_history/__init__.py +++ b/modules/product_cost_history/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product - -__all__ = ['register'] - - -def register(): - Pool.register( - product.Product, - product.CostPrice, - product.ProductCostHistory, - module='product_cost_history', type_='model') diff --git a/modules/product_cost_history/tryton.cfg b/modules/product_cost_history/tryton.cfg index 4b37432933..92ccb37643 100644 --- a/modules/product_cost_history/tryton.cfg +++ b/modules/product_cost_history/tryton.cfg @@ -6,3 +6,9 @@ depends: stock xml: product.xml + +[register] +model: + product.Product + product.CostPrice + product.ProductCostHistory diff --git a/modules/product_cost_warehouse/__init__.py b/modules/product_cost_warehouse/__init__.py index d94a36c5df..4effdfa4a2 100644 --- a/modules/product_cost_warehouse/__init__.py +++ b/modules/product_cost_warehouse/__init__.py @@ -1,40 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, company, ir, product, res, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - ir.Cron, - ir.CronWarehouse, - res.User, - company.Company, - product.Configuration, - product.ConfigurationCostPriceWarehouse, - product.Product, - product.CostPrice, - product.CostPriceRevision, - stock.Configuration, - stock.ConfigurationLocation, - stock.Location, - stock.Move, - stock.ShipmentInternal, - module='product_cost_warehouse', type_='model') - Pool.register( - account.InvoiceLine, - module='product_cost_warehouse', type_='model', - depends=['account_invoice_stock']) - Pool.register( - product.ProductCostHistory, - module='product_cost_warehouse', type_='model', - depends=['product_cost_history']) - Pool.register( - product.ModifyCostPrice, - module='product_cost_warehouse', type_='wizard') - Pool.register( - module='product_cost_warehouse', type_='report') diff --git a/modules/product_cost_warehouse/tryton.cfg b/modules/product_cost_warehouse/tryton.cfg index 629a713987..d06d486f5b 100644 --- a/modules/product_cost_warehouse/tryton.cfg +++ b/modules/product_cost_warehouse/tryton.cfg @@ -16,3 +16,30 @@ xml: product.xml stock.xml message.xml + +[register] +model: + ir.Cron + ir.CronWarehouse + res.User + company.Company + product.Configuration + product.ConfigurationCostPriceWarehouse + product.Product + product.CostPrice + product.CostPriceRevision + stock.Configuration + stock.ConfigurationLocation + stock.Location + stock.Move + stock.ShipmentInternal +wizard: + product.ModifyCostPrice + +[register account_invoice_stock] +model: + account.InvoiceLine + +[register product_cost_history] +model: + product.ProductCostHistory diff --git a/modules/product_image/__init__.py b/modules/product_image/__init__.py index dd5305278d..aed6e0e6c7 100644 --- a/modules/product_image/__init__.py +++ b/modules/product_image/__init__.py @@ -1,24 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool +from . import routes -from . import product, routes - -__all__ = ['register', 'routes'] - - -def register(): - Pool.register( - product.Template, - product.Product, - product.Image, - product.ImageCache, - product.Category, - product.CategoryImage, - product.CategoryImageCache, - module='product_image', type_='model') - Pool.register( - module='product_image', type_='wizard') - Pool.register( - module='product_image', type_='report') +__all__ = [routes] diff --git a/modules/product_image/tryton.cfg b/modules/product_image/tryton.cfg index 5c6d029bb7..ed3a90cf08 100644 --- a/modules/product_image/tryton.cfg +++ b/modules/product_image/tryton.cfg @@ -6,3 +6,13 @@ depends: xml: product.xml message.xml + +[register] +model: + product.Template + product.Product + product.Image + product.ImageCache + product.Category + product.CategoryImage + product.CategoryImageCache diff --git a/modules/product_image_attribute/__init__.py b/modules/product_image_attribute/__init__.py index dba0f32555..4effdfa4a2 100644 --- a/modules/product_image_attribute/__init__.py +++ b/modules/product_image_attribute/__init__.py @@ -1,15 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product - -__all__ = ['register'] - - -def register(): - Pool.register( - product.Product, - product.Image, - module='product_image_attribute', type_='model') diff --git a/modules/product_image_attribute/tryton.cfg b/modules/product_image_attribute/tryton.cfg index 1d9d7dde0a..21ce1604ac 100644 --- a/modules/product_image_attribute/tryton.cfg +++ b/modules/product_image_attribute/tryton.cfg @@ -7,3 +7,8 @@ depends: product_image xml: product.xml + +[register] +model: + product.Product + product.Image diff --git a/modules/product_kit/__init__.py b/modules/product_kit/__init__.py index 3fbb35c453..4effdfa4a2 100644 --- a/modules/product_kit/__init__.py +++ b/modules/product_kit/__init__.py @@ -1,56 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import account, product, purchase, sale, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - product.Template, - product.Product, - product.Component, - module='product_kit', type_='model') - Pool.register( - account.Invoice, - account.InvoiceLine, - module='product_kit', type_='model', depends=['account_invoice_stock']) - Pool.register( - stock.Move, - module='product_kit', type_='model', depends=['stock']) - Pool.register( - sale.Sale, - sale.Line, - sale.LineComponent, - sale.LineComponentIgnoredMove, - sale.LineComponentRecreatedMove, - stock.ShipmentOutReturn, - stock.MoveSale, - account.InvoiceLineSale, - module='product_kit', type_='model', depends=['sale']) - Pool.register( - sale.HandleShipmentException, - module='product_kit', type_='wizard', depends=['sale']) - Pool.register( - sale.Amendment, - sale.AmendmentLine, - module='product_kit', type_='model', depends=['sale_amendment']) - Pool.register( - purchase.Purchase, - purchase.Line, - purchase.LineComponent, - purchase.LineComponentIgnoredMove, - purchase.LineComponentRecreatedMove, - stock.ShipmentIn, - stock.MovePurchase, - account.InvoiceLinePurchase, - module='product_kit', type_='model', depends=['purchase']) - Pool.register( - purchase.HandleShipmentException, - module='product_kit', type_='wizard', depends=['purchase']) - Pool.register( - purchase.Amendment, - purchase.AmendmentLine, - module='product_kit', type_='model', depends=['purchase_amendment']) diff --git a/modules/product_kit/tryton.cfg b/modules/product_kit/tryton.cfg index ea61e54f8d..d036585f87 100644 --- a/modules/product_kit/tryton.cfg +++ b/modules/product_kit/tryton.cfg @@ -16,3 +16,54 @@ xml: product.xml sale.xml purchase.xml + +[register] +model: + product.Template + product.Product + product.Component + +[register account_invoice_stock] +model: + account.Invoice + account.InvoiceLine + +[register purchase] +model: + purchase.Purchase + purchase.Line + purchase.LineComponent + purchase.LineComponentIgnoredMove + purchase.LineComponentRecreatedMove + stock.ShipmentIn + stock.MovePurchase + account.InvoiceLinePurchase +wizard: + purchase.HandleShipmentException + +[register purchase_amendment] +model: + purchase.Amendment + purchase.AmendmentLine + +[register sale] +model: + sale.Sale + sale.Line + sale.LineComponent + sale.LineComponentIgnoredMove + sale.LineComponentRecreatedMove + stock.ShipmentOutReturn + stock.MoveSale + account.InvoiceLineSale +wizard: + sale.HandleShipmentException + +[register sale_amendment] +model: + sale.Amendment + sale.AmendmentLine + +[register stock] +model: + stock.Move diff --git a/modules/product_measurements/__init__.py b/modules/product_measurements/__init__.py index 9d78dc4712..4effdfa4a2 100644 --- a/modules/product_measurements/__init__.py +++ b/modules/product_measurements/__init__.py @@ -1,13 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product - - -def register(): - Pool.register( - product.Template, - product.Product, - module='product_measurements', type_='model') diff --git a/modules/product_measurements/tryton.cfg b/modules/product_measurements/tryton.cfg index 2c84512ad9..1e0687bba9 100644 --- a/modules/product_measurements/tryton.cfg +++ b/modules/product_measurements/tryton.cfg @@ -6,3 +6,8 @@ depends: res xml: product.xml + +[register] +model: + product.Template + product.Product diff --git a/modules/product_price_list/__init__.py b/modules/product_price_list/__init__.py index 23cbc2447e..dd0dc846ac 100644 --- a/modules/product_price_list/__init__.py +++ b/modules/product_price_list/__init__.py @@ -1,16 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool -from . import price_list -from .price_list import Null - -__all__ = ['register', 'Null'] +__all__ = ['Null'] -def register(): - Pool.register( - price_list.PriceList, - price_list.PriceListLine, - price_list.PriceListLineContext, - module='product_price_list', type_='model') +def __getattr__(name): + if name == 'Null': + from .price_list import Null + return Null + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/product_price_list/tryton.cfg b/modules/product_price_list/tryton.cfg index a0461a3942..4c8b3352a4 100644 --- a/modules/product_price_list/tryton.cfg +++ b/modules/product_price_list/tryton.cfg @@ -7,3 +7,9 @@ depends: xml: price_list.xml message.xml + +[register] +model: + price_list.PriceList + price_list.PriceListLine + price_list.PriceListLineContext diff --git a/modules/product_price_list_cache/__init__.py b/modules/product_price_list_cache/__init__.py index 5df02ce0c7..4effdfa4a2 100644 --- a/modules/product_price_list_cache/__init__.py +++ b/modules/product_price_list_cache/__init__.py @@ -1,17 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import ir, product - -__all__ = ['register'] - - -def register(): - Pool.register( - ir.Cron, - product.Product, - product.PriceList, - product.PriceListCache, - module='product_price_list_cache', type_='model') diff --git a/modules/product_price_list_cache/tryton.cfg b/modules/product_price_list_cache/tryton.cfg index b4f8914a90..9ded40604a 100644 --- a/modules/product_price_list_cache/tryton.cfg +++ b/modules/product_price_list_cache/tryton.cfg @@ -6,3 +6,10 @@ depends: product_price_list xml: product.xml + +[register] +model: + ir.Cron + product.Product + product.PriceList + product.PriceListCache diff --git a/modules/product_price_list_dates/__init__.py b/modules/product_price_list_dates/__init__.py index cc56207fc4..4effdfa4a2 100644 --- a/modules/product_price_list_dates/__init__.py +++ b/modules/product_price_list_dates/__init__.py @@ -1,29 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product, purchase, sale - -__all__ = ['register'] - - -def register(): - Pool.register( - product.PriceList, - product.PriceListLine, - product.PriceListLineContext, - module='product_price_list_dates', type_='model') - Pool.register( - product.PriceListCache, - module='product_price_list_dates', type_='model', - depends=['product_price_list_cache']) - Pool.register( - sale.Line, - product.SaleContext, - module='product_price_list_dates', type_='model', - depends=['sale_price_list']) - Pool.register( - purchase.Line, - module='product_price_list_dates', type_='model', - depends=['purchase_price_list']) diff --git a/modules/product_price_list_dates/tryton.cfg b/modules/product_price_list_dates/tryton.cfg index 7622bed096..2ed5bc6777 100644 --- a/modules/product_price_list_dates/tryton.cfg +++ b/modules/product_price_list_dates/tryton.cfg @@ -8,3 +8,22 @@ extras_depend: sale_price_list xml: product.xml + +[register] +model: + product.PriceList + product.PriceListLine + product.PriceListLineContext + +[register product_price_list_cache] +model: + product.PriceListCache + +[register purchase_price_list] +model: + purchase.Line + +[register sale_price_list] +model: + sale.Line + product.SaleContext diff --git a/modules/product_price_list_parent/__init__.py b/modules/product_price_list_parent/__init__.py index 4c9b834d22..4effdfa4a2 100644 --- a/modules/product_price_list_parent/__init__.py +++ b/modules/product_price_list_parent/__init__.py @@ -1,15 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product - -__all__ = ['register'] - - -def register(): - Pool.register( - product.PriceList, - product.PriceListLine, - module='product_price_list_parent', type_='model') diff --git a/modules/product_price_list_parent/tryton.cfg b/modules/product_price_list_parent/tryton.cfg index 0d00cd2f4b..28a1d67658 100644 --- a/modules/product_price_list_parent/tryton.cfg +++ b/modules/product_price_list_parent/tryton.cfg @@ -5,3 +5,8 @@ depends: product_price_list xml: product.xml + +[register] +model: + product.PriceList + product.PriceListLine diff --git a/modules/production/__init__.py b/modules/production/__init__.py index 0b6768155d..4effdfa4a2 100644 --- a/modules/production/__init__.py +++ b/modules/production/__init__.py @@ -1,35 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import bom, configuration, ir, product, production, stock - - -def register(): - Pool.register( - configuration.Configuration, - configuration.ConfigurationProductionSequence, - bom.BOM, - bom.BOMInput, - bom.BOMOutput, - bom.BOMTree, - bom.OpenBOMTreeStart, - bom.OpenBOMTreeTree, - production.Production, - product.Template, - product.Product, - product.ProductBom, - product.ProductionLeadTime, - stock.Location, - stock.Move, - stock.ProductQuantitiesByWarehouseMove, - ir.Cron, - module='production', type_='model') - Pool.register( - stock.LotTrace, - production.Production_Lot, - module='production', type_='model', depends=['stock_lot']) - Pool.register( - bom.OpenBOMTree, - module='production', type_='wizard') diff --git a/modules/production/tryton.cfg b/modules/production/tryton.cfg index 94ce413b12..d9a6940518 100644 --- a/modules/production/tryton.cfg +++ b/modules/production/tryton.cfg @@ -15,3 +15,30 @@ xml: product.xml stock.xml message.xml + +[register] +model: + ir.Cron + configuration.Configuration + configuration.ConfigurationProductionSequence + bom.BOM + bom.BOMInput + bom.BOMOutput + bom.BOMTree + bom.OpenBOMTreeStart + bom.OpenBOMTreeTree + production.Production + product.Template + product.Product + product.ProductBom + product.ProductionLeadTime + stock.Location + stock.Move + stock.ProductQuantitiesByWarehouseMove +wizard: + bom.OpenBOMTree + +[register stock_lot] +model: + stock.LotTrace + production.Production_Lot diff --git a/modules/production_outsourcing/__init__.py b/modules/production_outsourcing/__init__.py index f291199f38..4effdfa4a2 100644 --- a/modules/production_outsourcing/__init__.py +++ b/modules/production_outsourcing/__init__.py @@ -1,20 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import production, purchase - -__all__ = ['register'] - - -def register(): - Pool.register( - production.Routing, - production.Production, - purchase.Line, - module='production_outsourcing', type_='model') - Pool.register( - module='production_outsourcing', type_='wizard') - Pool.register( - module='production_outsourcing', type_='report') diff --git a/modules/production_outsourcing/tryton.cfg b/modules/production_outsourcing/tryton.cfg index 34ae2308a4..ac30641acf 100644 --- a/modules/production_outsourcing/tryton.cfg +++ b/modules/production_outsourcing/tryton.cfg @@ -10,3 +10,9 @@ xml: production.xml purchase.xml message.xml + +[register] +model: + production.Routing + production.Production + purchase.Line diff --git a/modules/production_routing/__init__.py b/modules/production_routing/__init__.py index b9863a4ff7..4effdfa4a2 100644 --- a/modules/production_routing/__init__.py +++ b/modules/production_routing/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product, production, routing - - -def register(): - Pool.register( - routing.Routing, - routing.RoutingOperation, - routing.RoutingStep, - routing.Routing_BOM, - production.Production, - product.ProductBom, - product.ProductionLeadTime, - module='production_routing', type_='model') diff --git a/modules/production_routing/tryton.cfg b/modules/production_routing/tryton.cfg index aef9d03fc9..e0dee14121 100644 --- a/modules/production_routing/tryton.cfg +++ b/modules/production_routing/tryton.cfg @@ -9,3 +9,13 @@ xml: routing.xml production.xml product.xml + +[register] +model: + routing.Routing + routing.RoutingOperation + routing.RoutingStep + routing.Routing_BOM + production.Production + product.ProductBom + product.ProductionLeadTime diff --git a/modules/production_split/__init__.py b/modules/production_split/__init__.py index 5c7f014ef7..4effdfa4a2 100644 --- a/modules/production_split/__init__.py +++ b/modules/production_split/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import production - - -def register(): - Pool.register( - production.Production, - production.SplitProductionStart, - module='production_split', type_='model') - Pool.register( - production.SplitProduction, - module='production_split', type_='wizard') diff --git a/modules/production_split/tryton.cfg b/modules/production_split/tryton.cfg index 50b9ba7c6f..71b0c9b8e5 100644 --- a/modules/production_split/tryton.cfg +++ b/modules/production_split/tryton.cfg @@ -5,3 +5,10 @@ depends: production xml: production.xml + +[register] +model: + production.Production + production.SplitProductionStart +wizard: + production.SplitProduction diff --git a/modules/production_work/__init__.py b/modules/production_work/__init__.py index b203a1383f..4effdfa4a2 100644 --- a/modules/production_work/__init__.py +++ b/modules/production_work/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import production, routing, work - - -def register(): - Pool.register( - work.WorkCenterCategory, - work.WorkCenter, - work.Work, - work.WorkCycle, - routing.Operation, - routing.RoutingStep, - production.Production, - module='production_work', type_='model') diff --git a/modules/production_work/tryton.cfg b/modules/production_work/tryton.cfg index 0c2044a746..75206254da 100644 --- a/modules/production_work/tryton.cfg +++ b/modules/production_work/tryton.cfg @@ -12,3 +12,13 @@ xml: routing.xml production.xml message.xml + +[register] +model: + work.WorkCenterCategory + work.WorkCenter + work.Work + work.WorkCycle + routing.Operation + routing.RoutingStep + production.Production diff --git a/modules/production_work_timesheet/__init__.py b/modules/production_work_timesheet/__init__.py index ce037b96ab..4effdfa4a2 100644 --- a/modules/production_work_timesheet/__init__.py +++ b/modules/production_work_timesheet/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import routing, timesheet, work - - -def register(): - Pool.register( - work.Work, - routing.Operation, - timesheet.Work, - module='production_work_timesheet', type_='model') diff --git a/modules/production_work_timesheet/tryton.cfg b/modules/production_work_timesheet/tryton.cfg index 411c81b88e..857627f8a4 100644 --- a/modules/production_work_timesheet/tryton.cfg +++ b/modules/production_work_timesheet/tryton.cfg @@ -8,3 +8,9 @@ depends: xml: work.xml routing.xml + +[register] +model: + work.Work + routing.Operation + timesheet.Work diff --git a/modules/project/__init__.py b/modules/project/__init__.py index c8ebed9802..4effdfa4a2 100644 --- a/modules/project/__init__.py +++ b/modules/project/__init__.py @@ -1,21 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import ir, party, timesheet, work - - -def register(): - Pool.register( - # Before Work because status default value is read from WorkStatus - work.WorkStatus, - work.Work, - timesheet.Line, - timesheet.Work, - ir.ActWindow, - module='project', type_='model') - Pool.register( - party.Replace, - party.Erase, - module='project', type_='wizard') diff --git a/modules/project/tryton.cfg b/modules/project/tryton.cfg index 005986b028..19ea85b5b7 100644 --- a/modules/project/tryton.cfg +++ b/modules/project/tryton.cfg @@ -11,3 +11,15 @@ xml: work.xml timesheet.xml message.xml + +[register] +model: + # Before Work because status default value is read from WorkStatus + work.WorkStatus + work.Work + timesheet.Line + timesheet.Work + ir.ActWindow +wizard: + party.Replace + party.Erase diff --git a/modules/project_invoice/__init__.py b/modules/project_invoice/__init__.py index 1333d791d5..4effdfa4a2 100644 --- a/modules/project_invoice/__init__.py +++ b/modules/project_invoice/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import invoice, project, timesheet - - -def register(): - Pool.register( - project.Work, - project.WorkInvoicedProgress, - timesheet.Line, - invoice.InvoiceLine, - module='project_invoice', type_='model') - Pool.register( - project.OpenInvoice, - module='project_invoice', type_='wizard') diff --git a/modules/project_invoice/tryton.cfg b/modules/project_invoice/tryton.cfg index 04497b713b..0c4ecc9b2c 100644 --- a/modules/project_invoice/tryton.cfg +++ b/modules/project_invoice/tryton.cfg @@ -14,3 +14,12 @@ xml: project.xml timesheet.xml message.xml + +[register] +model: + project.Work + project.WorkInvoicedProgress + timesheet.Line + invoice.InvoiceLine +wizard: + project.OpenInvoice diff --git a/modules/project_plan/__init__.py b/modules/project_plan/__init__.py index 2edbec62d9..4effdfa4a2 100644 --- a/modules/project_plan/__init__.py +++ b/modules/project_plan/__init__.py @@ -1,17 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import allocation, work - - -def register(): - Pool.register( - allocation.Allocation, - work.Work, - work.PredecessorSuccessor, - module='project_plan', type_='model') - Pool.register( - work.Leveling, - module='project_plan', type_='wizard') diff --git a/modules/project_plan/tryton.cfg b/modules/project_plan/tryton.cfg index ee27cc8853..18da584f58 100644 --- a/modules/project_plan/tryton.cfg +++ b/modules/project_plan/tryton.cfg @@ -8,3 +8,11 @@ depends: xml: work.xml allocation.xml + +[register] +model: + allocation.Allocation + work.Work + work.PredecessorSuccessor +wizard: + work.Leveling diff --git a/modules/project_revenue/__init__.py b/modules/project_revenue/__init__.py index 53012ac6ed..4effdfa4a2 100644 --- a/modules/project_revenue/__init__.py +++ b/modules/project_revenue/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import purchase, work - - -def register(): - Pool.register( - work.Work, - module='project_revenue', type_='model') - Pool.register( - purchase.Line, - module='project_revenue', type_='model', - depends=['purchase']) diff --git a/modules/project_revenue/tryton.cfg b/modules/project_revenue/tryton.cfg index 71d0a01acf..44b315f283 100644 --- a/modules/project_revenue/tryton.cfg +++ b/modules/project_revenue/tryton.cfg @@ -12,3 +12,11 @@ extras_depend: xml: work.xml purchase.xml + +[register] +model: + work.Work + +[register purchase] +model: + purchase.Line diff --git a/modules/purchase/__init__.py b/modules/purchase/__init__.py index 619e3a9293..4effdfa4a2 100644 --- a/modules/purchase/__init__.py +++ b/modules/purchase/__init__.py @@ -1,58 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import ( - configuration, invoice, party, product, purchase, purchase_reporting, - stock) - - -def register(): - Pool.register( - stock.Move, - purchase.Purchase, - purchase.PurchaseIgnoredInvoice, - purchase.PurchaseRecreatedInvoice, - purchase.Line, - purchase.LineTax, - purchase.LineIgnoredMove, - purchase.LineRecreatedMove, - product.Template, - product.Product, - product.ProductSupplier, - product.ProductSupplierPrice, - stock.ShipmentIn, - stock.ShipmentInReturn, - purchase.HandleShipmentExceptionAsk, - purchase.HandleInvoiceExceptionAsk, - configuration.Configuration, - configuration.ConfigurationSequence, - configuration.ConfigurationPurchaseMethod, - invoice.Invoice, - invoice.InvoiceLine, - stock.Location, - party.Party, - party.CustomerCode, - party.SupplierLeadTime, - party.PartySupplierCurrency, - purchase.ReturnPurchaseStart, - purchase_reporting.Context, - purchase_reporting.Main, - purchase_reporting.MainTimeseries, - purchase_reporting.Supplier, - purchase_reporting.SupplierTimeseries, - purchase_reporting.Product, - purchase_reporting.ProductTimeseries, - module='purchase', type_='model') - Pool.register( - purchase.PurchaseReport, - module='purchase', type_='report') - Pool.register( - purchase.HandleShipmentException, - purchase.HandleInvoiceException, - party.PartyReplace, - party.PartyErase, - purchase.ModifyHeader, - purchase.ReturnPurchase, - module='purchase', type_='wizard') diff --git a/modules/purchase/tryton.cfg b/modules/purchase/tryton.cfg index 1178769d25..73572ba29c 100644 --- a/modules/purchase/tryton.cfg +++ b/modules/purchase/tryton.cfg @@ -21,3 +21,49 @@ xml: product.xml invoice.xml message.xml + +[register] +model: + party.Party + party.CustomerCode + party.SupplierLeadTime + party.PartySupplierCurrency + product.Template + product.Product + product.ProductSupplier + product.ProductSupplierPrice + stock.Location + stock.Move + stock.ShipmentIn + stock.ShipmentInReturn + invoice.Invoice + invoice.InvoiceLine + configuration.Configuration + configuration.ConfigurationSequence + configuration.ConfigurationPurchaseMethod + purchase.Purchase + purchase.PurchaseIgnoredInvoice + purchase.PurchaseRecreatedInvoice + purchase.Line + purchase.LineTax + purchase.LineIgnoredMove + purchase.LineRecreatedMove + purchase.HandleShipmentExceptionAsk + purchase.HandleInvoiceExceptionAsk + purchase.ReturnPurchaseStart + purchase_reporting.Context + purchase_reporting.Main + purchase_reporting.MainTimeseries + purchase_reporting.Supplier + purchase_reporting.SupplierTimeseries + purchase_reporting.Product + purchase_reporting.ProductTimeseries +wizard: + purchase.HandleShipmentException + purchase.HandleInvoiceException + party.PartyReplace + party.PartyErase + purchase.ModifyHeader + purchase.ReturnPurchase +report: + purchase.PurchaseReport diff --git a/modules/purchase_amendment/__init__.py b/modules/purchase_amendment/__init__.py index c21bd525e2..4effdfa4a2 100644 --- a/modules/purchase_amendment/__init__.py +++ b/modules/purchase_amendment/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import purchase - -__all__ = ['register'] - - -def register(): - Pool.register( - purchase.Purchase, - purchase.Amendment, - purchase.AmendmentLine, - module='purchase_amendment', type_='model') diff --git a/modules/purchase_amendment/tryton.cfg b/modules/purchase_amendment/tryton.cfg index dd7dd85a5f..f4735a0c57 100644 --- a/modules/purchase_amendment/tryton.cfg +++ b/modules/purchase_amendment/tryton.cfg @@ -9,3 +9,9 @@ depends: xml: purchase.xml message.xml + +[register] +model: + purchase.Purchase + purchase.Amendment + purchase.AmendmentLine diff --git a/modules/purchase_blanket_agreement/__init__.py b/modules/purchase_blanket_agreement/__init__.py index 7b2987bf73..4effdfa4a2 100644 --- a/modules/purchase_blanket_agreement/__init__.py +++ b/modules/purchase_blanket_agreement/__init__.py @@ -1,23 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import purchase - -__all__ = ['register'] - - -def register(): - Pool.register( - purchase.Configuration, - purchase.ConfigurationSequence, - purchase.BlanketAgreement, - purchase.BlanketAgreementLine, - purchase.Purchase, - purchase.Line, - purchase.BlanketAgreementCreatePurchaseStart, - module='purchase_blanket_agreement', type_='model') - Pool.register( - purchase.BlanketAgreementCreatePurchase, - module='purchase_blanket_agreement', type_='wizard') diff --git a/modules/purchase_blanket_agreement/tryton.cfg b/modules/purchase_blanket_agreement/tryton.cfg index f77fcb5544..dce9b96d03 100644 --- a/modules/purchase_blanket_agreement/tryton.cfg +++ b/modules/purchase_blanket_agreement/tryton.cfg @@ -11,3 +11,15 @@ xml: message.xml product.xml purchase.xml + +[register] +model: + purchase.Configuration + purchase.ConfigurationSequence + purchase.BlanketAgreement + purchase.BlanketAgreementLine + purchase.Purchase + purchase.Line + purchase.BlanketAgreementCreatePurchaseStart +wizard: + purchase.BlanketAgreementCreatePurchase diff --git a/modules/purchase_history/__init__.py b/modules/purchase_history/__init__.py index 77c9f45e8a..4effdfa4a2 100644 --- a/modules/purchase_history/__init__.py +++ b/modules/purchase_history/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import purchase - -__all__ = ['register'] - - -def register(): - Pool.register( - purchase.Purchase, - purchase.Line, - purchase.LineTax, - module='purchase_history', type_='model') diff --git a/modules/purchase_history/tryton.cfg b/modules/purchase_history/tryton.cfg index 18069587f9..eb0da71862 100644 --- a/modules/purchase_history/tryton.cfg +++ b/modules/purchase_history/tryton.cfg @@ -5,3 +5,9 @@ depends: purchase xml: purchase.xml + +[register] +model: + purchase.Purchase + purchase.Line + purchase.LineTax diff --git a/modules/purchase_invoice_line_standalone/__init__.py b/modules/purchase_invoice_line_standalone/__init__.py index 52c1f38bce..4effdfa4a2 100644 --- a/modules/purchase_invoice_line_standalone/__init__.py +++ b/modules/purchase_invoice_line_standalone/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import party, purchase - - -def register(): - Pool.register( - party.Party, - party.PartyPurchaseInvoiceLineStandalone, - purchase.Purchase, - purchase.PurchaseIgnoredInvoiceLine, - module='purchase_invoice_line_standalone', type_='model') - Pool.register( - purchase.HandleInvoiceException, - module='purchase_invoice_line_standalone', type_='wizard') diff --git a/modules/purchase_invoice_line_standalone/tryton.cfg b/modules/purchase_invoice_line_standalone/tryton.cfg index 7a13595a4f..084decdf06 100644 --- a/modules/purchase_invoice_line_standalone/tryton.cfg +++ b/modules/purchase_invoice_line_standalone/tryton.cfg @@ -8,3 +8,12 @@ depends: xml: party.xml purchase.xml + +[register] +model: + party.Party + party.PartyPurchaseInvoiceLineStandalone + purchase.Purchase + purchase.PurchaseIgnoredInvoiceLine +wizard: + purchase.HandleInvoiceException diff --git a/modules/purchase_price_list/__init__.py b/modules/purchase_price_list/__init__.py index 37fdd95417..4effdfa4a2 100644 --- a/modules/purchase_price_list/__init__.py +++ b/modules/purchase_price_list/__init__.py @@ -1,19 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import party, product, purchase - -__all__ = ['register'] - - -def register(): - Pool.register( - party.Party, - party.PartyPurchasePriceList, - product.Product, - product.PriceList, - purchase.Purchase, - purchase.Line, - module='purchase_price_list', type_='model') diff --git a/modules/purchase_price_list/tryton.cfg b/modules/purchase_price_list/tryton.cfg index fa34e607c4..34ed949525 100644 --- a/modules/purchase_price_list/tryton.cfg +++ b/modules/purchase_price_list/tryton.cfg @@ -10,3 +10,12 @@ depends: purchase xml: party.xml + +[register] +model: + party.Party + party.PartyPurchasePriceList + product.Product + product.PriceList + purchase.Purchase + purchase.Line diff --git a/modules/purchase_product_quantity/__init__.py b/modules/purchase_product_quantity/__init__.py index 9a601a2ac5..4effdfa4a2 100644 --- a/modules/purchase_product_quantity/__init__.py +++ b/modules/purchase_product_quantity/__init__.py @@ -1,17 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product, purchase - -__all__ = ['register'] - - -def register(): - Pool.register( - product.ProductSupplier, - module='purchase_product_quantity', type_='model') - Pool.register( - purchase.RequestCreatePurchase, - module='purchase_product_quantity', type_='wizard') diff --git a/modules/purchase_product_quantity/tryton.cfg b/modules/purchase_product_quantity/tryton.cfg index cb5428069f..96a3b11e26 100644 --- a/modules/purchase_product_quantity/tryton.cfg +++ b/modules/purchase_product_quantity/tryton.cfg @@ -7,3 +7,9 @@ depends: purchase_request xml: product.xml + +[register] +model: + product.ProductSupplier +wizard: + purchase.RequestCreatePurchase diff --git a/modules/purchase_request/__init__.py b/modules/purchase_request/__init__.py index 031d1c175a..4effdfa4a2 100644 --- a/modules/purchase_request/__init__.py +++ b/modules/purchase_request/__init__.py @@ -1,21 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import party, purchase, purchase_request - - -def register(): - Pool.register( - purchase_request.PurchaseRequest, - purchase_request.HandlePurchaseCancellationExceptionStart, - purchase_request.CreatePurchaseAskParty, - purchase.Purchase, - purchase.Line, - module='purchase_request', type_='model') - Pool.register( - purchase_request.CreatePurchase, - purchase_request.HandlePurchaseCancellationException, - party.Replace, - module='purchase_request', type_='wizard') diff --git a/modules/purchase_request/tryton.cfg b/modules/purchase_request/tryton.cfg index 009eec2c2f..6b03bdfcb0 100644 --- a/modules/purchase_request/tryton.cfg +++ b/modules/purchase_request/tryton.cfg @@ -8,3 +8,15 @@ xml: purchase_request.xml purchase.xml message.xml + +[register] +model: + purchase.Purchase + purchase.Line + purchase_request.PurchaseRequest + purchase_request.HandlePurchaseCancellationExceptionStart + purchase_request.CreatePurchaseAskParty +wizard: + party.Replace + purchase_request.CreatePurchase + purchase_request.HandlePurchaseCancellationException diff --git a/modules/purchase_request_quotation/__init__.py b/modules/purchase_request_quotation/__init__.py index 0cad3541a3..4effdfa4a2 100644 --- a/modules/purchase_request_quotation/__init__.py +++ b/modules/purchase_request_quotation/__init__.py @@ -1,27 +1,2 @@ -# This file is part purchase_request_for_quotation module for Tryton. -# The COPYRIGHT file at the top level of this repository contains -# the full copyright notices and license terms. -from trytond.pool import Pool - -from . import purchase - -__all__ = ['register'] - - -def register(): - Pool.register( - purchase.Configuration, - purchase.ConfigurationSequence, - purchase.Quotation, - purchase.QuotationLine, - purchase.CreatePurchaseRequestQuotationAskSuppliers, - purchase.CreatePurchaseRequestQuotationSucceed, - purchase.PurchaseRequest, - module='purchase_request_quotation', type_='model') - Pool.register( - purchase.PurchaseRequestQuotationReport, - module='purchase_request_quotation', type_='report') - Pool.register( - purchase.CreatePurchaseRequestQuotation, - purchase.CreatePurchase, - module='purchase_request_quotation', type_='wizard') +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. diff --git a/modules/purchase_request_quotation/tryton.cfg b/modules/purchase_request_quotation/tryton.cfg index 6173eb589d..04dc1233f3 100644 --- a/modules/purchase_request_quotation/tryton.cfg +++ b/modules/purchase_request_quotation/tryton.cfg @@ -13,3 +13,18 @@ xml: purchase.xml purchase_request.xml message.xml + +[register] +model: + purchase.Configuration + purchase.ConfigurationSequence + purchase.Quotation + purchase.QuotationLine + purchase.CreatePurchaseRequestQuotationAskSuppliers + purchase.CreatePurchaseRequestQuotationSucceed + purchase.PurchaseRequest +wizard: + purchase.CreatePurchaseRequestQuotation + purchase.CreatePurchase +report: + purchase.PurchaseRequestQuotationReport diff --git a/modules/purchase_requisition/__init__.py b/modules/purchase_requisition/__init__.py index 5ea079d6d5..4effdfa4a2 100644 --- a/modules/purchase_requisition/__init__.py +++ b/modules/purchase_requisition/__init__.py @@ -1,21 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import ir, purchase - - -def register(): - Pool.register( - ir.Rule, - purchase.PurchaseRequest, - purchase.PurchaseRequisition, - purchase.PurchaseRequisitionLine, - purchase.Configuration, - purchase.ConfigurationSequence, - module='purchase_requisition', type_='model') - Pool.register( - purchase.HandlePurchaseCancellationException, - purchase.CreatePurchase, - module='purchase_requisition', type_='wizard') diff --git a/modules/purchase_requisition/tryton.cfg b/modules/purchase_requisition/tryton.cfg index e48b839842..1d7eb56857 100644 --- a/modules/purchase_requisition/tryton.cfg +++ b/modules/purchase_requisition/tryton.cfg @@ -11,3 +11,15 @@ depends: xml: purchase.xml message.xml + +[register] +model: + ir.Rule + purchase.Configuration + purchase.ConfigurationSequence + purchase.PurchaseRequest + purchase.PurchaseRequisition + purchase.PurchaseRequisitionLine +wizard: + purchase.HandlePurchaseCancellationException + purchase.CreatePurchase diff --git a/modules/purchase_secondary_unit/__init__.py b/modules/purchase_secondary_unit/__init__.py index 2cac160eb7..4effdfa4a2 100644 --- a/modules/purchase_secondary_unit/__init__.py +++ b/modules/purchase_secondary_unit/__init__.py @@ -1,32 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, product, purchase, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - account.InvoiceLine, - product.Template, - product.Product, - product.ProductSupplier, - purchase.Line, - stock.Move, - module='purchase_secondary_unit', type_='model') - Pool.register( - purchase.RequisitionLine, - module='purchase_secondary_unit', type_='model', - depends=['purchase_requisition']) - Pool.register( - purchase.BlanketAgreementLine, - purchase.LineBlanketAgreement, - module='purchase_secondary_unit', type_='model', - depends=['purchase_blanket_agreement']) - Pool.register( - purchase.AmendmentLine, - module='purchase_secondary_unit', type_='model', - depends=['purchase_amendment']) diff --git a/modules/purchase_secondary_unit/tryton.cfg b/modules/purchase_secondary_unit/tryton.cfg index 2e25dae29c..1be5d5708b 100644 --- a/modules/purchase_secondary_unit/tryton.cfg +++ b/modules/purchase_secondary_unit/tryton.cfg @@ -17,3 +17,25 @@ xml: purchase.xml stock.xml message.xml + +[register] +model: + product.Template + product.Product + product.ProductSupplier + stock.Move + account.InvoiceLine + purchase.Line + +[register purchase_amendment] +model: + purchase.AmendmentLine + +[register purchase_blanket_agreement] +model: + purchase.BlanketAgreementLine + purchase.LineBlanketAgreement + +[register purchase_requisition] +model: + purchase.RequisitionLine diff --git a/modules/purchase_shipment_cost/__init__.py b/modules/purchase_shipment_cost/__init__.py index f99868f089..4effdfa4a2 100644 --- a/modules/purchase_shipment_cost/__init__.py +++ b/modules/purchase_shipment_cost/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import carrier, stock - - -def register(): - Pool.register( - stock.ShipmentIn, - stock.Move, - carrier.Carrier, - module='purchase_shipment_cost', type_='model') diff --git a/modules/purchase_shipment_cost/tryton.cfg b/modules/purchase_shipment_cost/tryton.cfg index e54cf6c2bc..451bea69e5 100644 --- a/modules/purchase_shipment_cost/tryton.cfg +++ b/modules/purchase_shipment_cost/tryton.cfg @@ -17,3 +17,9 @@ extras_depend: xml: stock.xml carrier.xml + +[register] +model: + carrier.Carrier + stock.ShipmentIn + stock.Move diff --git a/modules/quality/__init__.py b/modules/quality/__init__.py index fc529f8ce8..af4ca9bf29 100644 --- a/modules/quality/__init__.py +++ b/modules/quality/__init__.py @@ -1,33 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import production, quality, stock -from .quality import ControlledMixin - -__all__ = ['register', 'ControlledMixin'] +__all__ = ['ControlledMixin'] -def register(): - Pool.register( - quality.Configuration, - quality.ConfigurationSequence, - quality.Control, - quality.ControlPoint, - quality.Inspection, - quality.Alert, - quality.InspectStore, - module='quality', type_='model') - Pool.register( - quality.Inspect, - module='quality', type_='wizard') - Pool.register( - stock.ShipmentIn, - stock.ShipmentOut, - stock.ShipmentOutReturn, - stock.ShipmentInternal, - module='quality', type_='model', depends=['stock']) - Pool.register( - production.Production, - module='quality', type_='model', depends=['production']) +def __getattr__(name): + if name == 'ControlledMixin': + from .quality import ControlledMixin + return ControlledMixin + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/quality/tryton.cfg b/modules/quality/tryton.cfg index a834e21f0d..1a713ab64c 100644 --- a/modules/quality/tryton.cfg +++ b/modules/quality/tryton.cfg @@ -13,3 +13,26 @@ xml: stock.xml production.xml message.xml + +[register] +model: + quality.Configuration + quality.ConfigurationSequence + quality.Control + quality.ControlPoint + quality.Inspection + quality.Alert + quality.InspectStore +wizard: + quality.Inspect + +[register production] +model: + production.Production + +[register stock] +model: + stock.ShipmentIn + stock.ShipmentOut + stock.ShipmentOutReturn + stock.ShipmentInternal diff --git a/modules/sale/__init__.py b/modules/sale/__init__.py index 81313b422b..4effdfa4a2 100644 --- a/modules/sale/__init__.py +++ b/modules/sale/__init__.py @@ -1,74 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import ( - configuration, invoice, ir, party, product, sale, sale_reporting, stock) - - -def register(): - Pool.register( - ir.Cron, - stock.Move, - configuration.Configuration, - configuration.ConfigurationSequence, - configuration.ConfigurationSaleMethod, - configuration.ConfigurationQuotation, - sale.Sale, - sale.SaleIgnoredInvoice, - sale.SaleRecreatedInvoice, - sale.SaleLine, - sale.SaleLineTax, - sale.SaleLineIgnoredMove, - sale.SaleLineRecreatedMove, - party.Party, - party.PartyCustomerCurrency, - party.PartySaleMethod, - product.Configuration, - product.DefaultLeadTime, - product.Template, - product.ProductLeadTime, - product.Product, - product.SaleContext, - stock.ShipmentOut, - stock.ShipmentOutReturn, - sale.HandleShipmentExceptionAsk, - sale.HandleInvoiceExceptionAsk, - sale.ReturnSaleStart, - sale_reporting.Context, - sale_reporting.Main, - sale_reporting.MainTimeseries, - sale_reporting.Customer, - sale_reporting.CustomerTimeseries, - sale_reporting.CustomerCategory, - sale_reporting.CustomerCategoryTimeseries, - sale_reporting.CustomerCategoryTree, - sale_reporting.Product, - sale_reporting.ProductTimeseries, - sale_reporting.ProductCategory, - sale_reporting.ProductCategoryTimeseries, - sale_reporting.ProductCategoryTree, - sale_reporting.RegionTree, - sale_reporting.Country, - sale_reporting.CountryTimeseries, - sale_reporting.Subdivision, - sale_reporting.SubdivisionTimeseries, - sale_reporting.CountryTree, - invoice.Invoice, - invoice.Line, - module='sale', type_='model') - Pool.register( - sale.HandleShipmentException, - sale.HandleInvoiceException, - sale.ReturnSale, - sale.ModifyHeader, - sale.OpenProduct, - party.Replace, - party.Erase, - sale_reporting.OpenRegionTree, - sale_reporting.OpenCountryTree, - module='sale', type_='wizard') - Pool.register( - sale.SaleReport, - module='sale', type_='report') diff --git a/modules/sale/tryton.cfg b/modules/sale/tryton.cfg index 5e4bafaea9..7562a70071 100644 --- a/modules/sale/tryton.cfg +++ b/modules/sale/tryton.cfg @@ -22,3 +22,66 @@ xml: product.xml invoice.xml message.xml + +[register] +model: + ir.Cron + party.Party + party.PartyCustomerCurrency + party.PartySaleMethod + product.Configuration + product.DefaultLeadTime + product.Template + product.ProductLeadTime + product.Product + product.SaleContext + stock.Move + stock.ShipmentOut + stock.ShipmentOutReturn + invoice.Invoice + invoice.Line + configuration.Configuration + configuration.ConfigurationSequence + configuration.ConfigurationSaleMethod + configuration.ConfigurationQuotation + sale.Sale + sale.SaleIgnoredInvoice + sale.SaleRecreatedInvoice + sale.SaleLine + sale.SaleLineTax + sale.SaleLineIgnoredMove + sale.SaleLineRecreatedMove + sale.HandleShipmentExceptionAsk + sale.HandleInvoiceExceptionAsk + sale.ReturnSaleStart + sale_reporting.Context + sale_reporting.Main + sale_reporting.MainTimeseries + sale_reporting.Customer + sale_reporting.CustomerTimeseries + sale_reporting.CustomerCategory + sale_reporting.CustomerCategoryTimeseries + sale_reporting.CustomerCategoryTree + sale_reporting.Product + sale_reporting.ProductTimeseries + sale_reporting.ProductCategory + sale_reporting.ProductCategoryTimeseries + sale_reporting.ProductCategoryTree + sale_reporting.RegionTree + sale_reporting.Country + sale_reporting.CountryTimeseries + sale_reporting.Subdivision + sale_reporting.SubdivisionTimeseries + sale_reporting.CountryTree +wizard: + party.Replace + party.Erase + sale.HandleShipmentException + sale.HandleInvoiceException + sale.ReturnSale + sale.ModifyHeader + sale.OpenProduct + sale_reporting.OpenRegionTree + sale_reporting.OpenCountryTree +report: + sale.SaleReport diff --git a/modules/sale_advance_payment/__init__.py b/modules/sale_advance_payment/__init__.py index cde5bc6687..4effdfa4a2 100644 --- a/modules/sale_advance_payment/__init__.py +++ b/modules/sale_advance_payment/__init__.py @@ -1,25 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, sale, stock - - -def register(): - Pool.register( - sale.AdvancePaymentTerm, - sale.AdvancePaymentTermLine, - sale.AdvancePaymentTermLineAccount, - sale.AdvancePaymentCondition, - sale.Sale, - sale.SaleLine, - account.AccountTypeTemplate, - account.AccountType, - account.Invoice, - account.InvoiceLine, - stock.ShipmentOut, - module='sale_advance_payment', type_='model') - Pool.register( - sale.HandleInvoiceException, - module='sale_advance_payment', type_='wizard') diff --git a/modules/sale_advance_payment/tryton.cfg b/modules/sale_advance_payment/tryton.cfg index d2154ae39d..cba5153871 100644 --- a/modules/sale_advance_payment/tryton.cfg +++ b/modules/sale_advance_payment/tryton.cfg @@ -17,3 +17,19 @@ xml: account_chart_es.xml account_chart_fr.xml message.xml + +[register] +model: + account.AccountTypeTemplate + account.AccountType + account.Invoice + account.InvoiceLine + stock.ShipmentOut + sale.AdvancePaymentTerm + sale.AdvancePaymentTermLine + sale.AdvancePaymentTermLineAccount + sale.AdvancePaymentCondition + sale.Sale + sale.SaleLine +wizard: + sale.HandleInvoiceException diff --git a/modules/sale_amendment/__init__.py b/modules/sale_amendment/__init__.py index 02389c96b5..4effdfa4a2 100644 --- a/modules/sale_amendment/__init__.py +++ b/modules/sale_amendment/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import sale - -__all__ = ['register'] - - -def register(): - Pool.register( - sale.Sale, - sale.Amendment, - sale.AmendmentLine, - module='sale_amendment', type_='model') diff --git a/modules/sale_amendment/tryton.cfg b/modules/sale_amendment/tryton.cfg index b32ce7eb4b..fd58029fe8 100644 --- a/modules/sale_amendment/tryton.cfg +++ b/modules/sale_amendment/tryton.cfg @@ -9,3 +9,9 @@ depends: xml: sale.xml message.xml + +[register] +model: + sale.Sale + sale.Amendment + sale.AmendmentLine diff --git a/modules/sale_blanket_agreement/__init__.py b/modules/sale_blanket_agreement/__init__.py index 58c232074d..4effdfa4a2 100644 --- a/modules/sale_blanket_agreement/__init__.py +++ b/modules/sale_blanket_agreement/__init__.py @@ -1,23 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import sale - -__all__ = ['register'] - - -def register(): - Pool.register( - sale.Configuration, - sale.ConfigurationSequence, - sale.BlanketAgreement, - sale.BlanketAgreementLine, - sale.Sale, - sale.Line, - sale.BlanketAgreementCreateSaleStart, - module='sale_blanket_agreement', type_='model') - Pool.register( - sale.BlanketAgreementCreateSale, - module='sale_blanket_agreement', type_='wizard') diff --git a/modules/sale_blanket_agreement/tryton.cfg b/modules/sale_blanket_agreement/tryton.cfg index be5b4bf6ee..f3a83f1d94 100644 --- a/modules/sale_blanket_agreement/tryton.cfg +++ b/modules/sale_blanket_agreement/tryton.cfg @@ -11,3 +11,15 @@ xml: message.xml product.xml sale.xml + +[register] +model: + sale.Configuration + sale.ConfigurationSequence + sale.BlanketAgreement + sale.BlanketAgreementLine + sale.Sale + sale.Line + sale.BlanketAgreementCreateSaleStart +wizard: + sale.BlanketAgreementCreateSale diff --git a/modules/sale_complaint/__init__.py b/modules/sale_complaint/__init__.py index 804f54fc02..4effdfa4a2 100644 --- a/modules/sale_complaint/__init__.py +++ b/modules/sale_complaint/__init__.py @@ -1,25 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, complaint, sale - - -def register(): - Pool.register( - complaint.Type, - complaint.Complaint, - complaint.Action, - complaint.Action_SaleLine, - complaint.Action_InvoiceLine, - sale.Configuration, - sale.ConfigurationSequence, - sale.Sale, - account.InvoiceLine, - module='sale_complaint', type_='model') - Pool.register( - complaint.Complaint_PromotionCoupon, - complaint.Action_PromotionCoupon, - module='sale_complaint', type_='model', - depends=['sale_promotion_coupon']) diff --git a/modules/sale_complaint/tryton.cfg b/modules/sale_complaint/tryton.cfg index aeff993602..f887b4b074 100644 --- a/modules/sale_complaint/tryton.cfg +++ b/modules/sale_complaint/tryton.cfg @@ -13,3 +13,20 @@ xml: sale.xml party.xml message.xml + +[register] +model: + sale.Configuration + sale.ConfigurationSequence + sale.Sale + complaint.Type + complaint.Complaint + complaint.Action + complaint.Action_SaleLine + complaint.Action_InvoiceLine + account.InvoiceLine + +[register sale_promotion_coupon] +model: + complaint.Complaint_PromotionCoupon + complaint.Action_PromotionCoupon diff --git a/modules/sale_credit_limit/__init__.py b/modules/sale_credit_limit/__init__.py index 8ebdad6e3e..4effdfa4a2 100644 --- a/modules/sale_credit_limit/__init__.py +++ b/modules/sale_credit_limit/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import party, sale - - -def register(): - Pool.register( - party.Party, - sale.Sale, - sale.Line, - module='sale_credit_limit', type_='model') diff --git a/modules/sale_credit_limit/tryton.cfg b/modules/sale_credit_limit/tryton.cfg index c03b9bb6d3..dc90453cc8 100644 --- a/modules/sale_credit_limit/tryton.cfg +++ b/modules/sale_credit_limit/tryton.cfg @@ -7,3 +7,9 @@ depends: currency account_invoice company + +[register] +model: + party.Party + sale.Sale + sale.Line diff --git a/modules/sale_discount/__init__.py b/modules/sale_discount/__init__.py index 31fb0fd597..4effdfa4a2 100644 --- a/modules/sale_discount/__init__.py +++ b/modules/sale_discount/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import sale - -__all__ = ['register'] - - -def register(): - Pool.register( - sale.Line, - module='sale_discount', type_='model') - Pool.register( - module='sale_discount', type_='wizard') - Pool.register( - module='sale_discount', type_='report') diff --git a/modules/sale_discount/tryton.cfg b/modules/sale_discount/tryton.cfg index 37715b1b1e..f5ca7920ff 100644 --- a/modules/sale_discount/tryton.cfg +++ b/modules/sale_discount/tryton.cfg @@ -6,3 +6,7 @@ depends: sale xml: sale.xml + +[register] +model: + sale.Line diff --git a/modules/sale_extra/__init__.py b/modules/sale_extra/__init__.py index ba779186aa..4effdfa4a2 100644 --- a/modules/sale_extra/__init__.py +++ b/modules/sale_extra/__init__.py @@ -1,15 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import sale - - -def register(): - Pool.register( - sale.Extra, - sale.ExtraLine, - sale.Sale, - sale.Line, - module='sale_extra', type_='model') diff --git a/modules/sale_extra/tryton.cfg b/modules/sale_extra/tryton.cfg index c08966c8dc..e7ab6b0b0d 100644 --- a/modules/sale_extra/tryton.cfg +++ b/modules/sale_extra/tryton.cfg @@ -10,3 +10,10 @@ depends: sale_price_list xml: sale.xml + +[register] +model: + sale.Extra + sale.ExtraLine + sale.Sale + sale.Line diff --git a/modules/sale_gift_card/__init__.py b/modules/sale_gift_card/__init__.py index 6a12ebf437..4effdfa4a2 100644 --- a/modules/sale_gift_card/__init__.py +++ b/modules/sale_gift_card/__init__.py @@ -1,41 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, product, sale, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - account.Configuration, - account.ConfigurationGiftCardAccount, - account.AccountTypeTemplate, - account.AccountType, - account.InvoiceLine, - product.Template, - product.Product, - sale.Configuration, - sale.ConfigurationGiftCardSequence, - sale.GiftCard, - sale.Sale, - sale.Line, - stock.Move, - module='sale_gift_card', type_='model') - Pool.register( - module='sale_gift_card', type_='wizard') - Pool.register( - sale.GiftCardReport, - sale.GiftCardEmail, - module='sale_gift_card', type_='report') - Pool.register( - sale.GiftCard_POS, - sale.POSSale, - sale.POSSaleLine, - sale.POSPayGiftCard, - module='sale_gift_card', type_='model', depends=['sale_point']) - Pool.register( - sale.POSPay, - module='sale_gift_card', type_='wizard', depends=['sale_point']) diff --git a/modules/sale_gift_card/tryton.cfg b/modules/sale_gift_card/tryton.cfg index 7383d69baa..38f32918bc 100644 --- a/modules/sale_gift_card/tryton.cfg +++ b/modules/sale_gift_card/tryton.cfg @@ -17,3 +17,31 @@ xml: sale.xml stock.xml message.xml + +[register] +model: + product.Template + product.Product + account.Configuration + account.ConfigurationGiftCardAccount + account.AccountTypeTemplate + account.AccountType + account.InvoiceLine + stock.Move + sale.Configuration + sale.ConfigurationGiftCardSequence + sale.GiftCard + sale.Sale + sale.Line +report: + sale.GiftCardReport + sale.GiftCardEmail + +[register sale_point] +model: + sale.GiftCard_POS + sale.POSSale + sale.POSSaleLine + sale.POSPayGiftCard +wizard: + sale.POSPay diff --git a/modules/sale_history/__init__.py b/modules/sale_history/__init__.py index 013878e495..4effdfa4a2 100644 --- a/modules/sale_history/__init__.py +++ b/modules/sale_history/__init__.py @@ -1,21 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import sale - -__all__ = ['register'] - - -def register(): - Pool.register( - sale.Sale, - sale.Line, - sale.LineTax, - module='sale_history', type_='model') - Pool.register( - sale.Subscription, - sale.SubscriptionLine, - module='sale_history', type_='model', - depends=['sale_subscription']) diff --git a/modules/sale_history/tryton.cfg b/modules/sale_history/tryton.cfg index fb38796687..c534aa74ee 100644 --- a/modules/sale_history/tryton.cfg +++ b/modules/sale_history/tryton.cfg @@ -7,3 +7,14 @@ extras_depend: sale_subscription xml: sale.xml + +[register] +model: + sale.Sale + sale.Line + sale.LineTax + +[register sale_subscription] +model: + sale.Subscription + sale.SubscriptionLine diff --git a/modules/sale_invoice_date/__init__.py b/modules/sale_invoice_date/__init__.py index 2fa103536c..4effdfa4a2 100644 --- a/modules/sale_invoice_date/__init__.py +++ b/modules/sale_invoice_date/__init__.py @@ -1,20 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import party, sale - -__all__ = ['register'] - - -def register(): - Pool.register( - sale.InvoiceTerm, - sale.InvoiceTermRelativeDelta, - sale.Configuration, - sale.ConfigurationSaleMethod, - sale.Sale, - party.Party, - party.PartySaleMethod, - module='sale_invoice_date', type_='model') diff --git a/modules/sale_invoice_date/tryton.cfg b/modules/sale_invoice_date/tryton.cfg index 74b3904cac..65a793f806 100644 --- a/modules/sale_invoice_date/tryton.cfg +++ b/modules/sale_invoice_date/tryton.cfg @@ -9,3 +9,13 @@ extras_depend: xml: sale.xml party.xml + +[register] +model: + sale.InvoiceTerm + sale.InvoiceTermRelativeDelta + sale.Configuration + sale.ConfigurationSaleMethod + sale.Sale + party.Party + party.PartySaleMethod diff --git a/modules/sale_invoice_grouping/__init__.py b/modules/sale_invoice_grouping/__init__.py index f9997511b9..4effdfa4a2 100644 --- a/modules/sale_invoice_grouping/__init__.py +++ b/modules/sale_invoice_grouping/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import configuration, party, sale - - -def register(): - Pool.register( - sale.Sale, - party.Party, - party.PartySaleInvoiceGroupingMethod, - configuration.Configuration, - configuration.ConfigurationSaleMethod, - module='sale_invoice_grouping', type_='model') diff --git a/modules/sale_invoice_grouping/tryton.cfg b/modules/sale_invoice_grouping/tryton.cfg index 41d63fda0c..c8e62988bd 100644 --- a/modules/sale_invoice_grouping/tryton.cfg +++ b/modules/sale_invoice_grouping/tryton.cfg @@ -9,3 +9,11 @@ depends: xml: party.xml configuration.xml + +[register] +model: + party.Party + party.PartySaleInvoiceGroupingMethod + configuration.Configuration + configuration.ConfigurationSaleMethod + sale.Sale diff --git a/modules/sale_opportunity/__init__.py b/modules/sale_opportunity/__init__.py index 7245b75277..4effdfa4a2 100644 --- a/modules/sale_opportunity/__init__.py +++ b/modules/sale_opportunity/__init__.py @@ -1,26 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import configuration, opportunity, opportunity_reporting, party, sale - - -def register(): - Pool.register( - opportunity.SaleOpportunity, - opportunity.SaleOpportunityLine, - opportunity_reporting.Context, - opportunity_reporting.Main, - opportunity_reporting.MainTimeseries, - opportunity_reporting.Conversion, - opportunity_reporting.ConversionTimeseries, - opportunity_reporting.ConversionEmployee, - opportunity_reporting.ConversionEmployeeTimeseries, - configuration.Configuration, - configuration.ConfigurationSequence, - sale.Sale, - module='sale_opportunity', type_='model') - Pool.register( - party.Replace, - module='sale_opportunity', type_='wizard') diff --git a/modules/sale_opportunity/tryton.cfg b/modules/sale_opportunity/tryton.cfg index 2b9983ae47..952092e98b 100644 --- a/modules/sale_opportunity/tryton.cfg +++ b/modules/sale_opportunity/tryton.cfg @@ -13,3 +13,20 @@ xml: configuration.xml opportunity_reporting.xml message.xml + +[register] +model: + configuration.Configuration + configuration.ConfigurationSequence + sale.Sale + opportunity.SaleOpportunity + opportunity.SaleOpportunityLine + opportunity_reporting.Context + opportunity_reporting.Main + opportunity_reporting.MainTimeseries + opportunity_reporting.Conversion + opportunity_reporting.ConversionTimeseries + opportunity_reporting.ConversionEmployee + opportunity_reporting.ConversionEmployeeTimeseries +wizard: + party.Replace diff --git a/modules/sale_payment/__init__.py b/modules/sale_payment/__init__.py index 5561c6142a..4effdfa4a2 100644 --- a/modules/sale_payment/__init__.py +++ b/modules/sale_payment/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import account, ir, sale - - -def register(): - Pool.register( - ir.Cron, - sale.Sale, - account.Payment, - account.Invoice, - module='sale_payment', type_='model') diff --git a/modules/sale_payment/tryton.cfg b/modules/sale_payment/tryton.cfg index 4c99ade420..48d2e632c9 100644 --- a/modules/sale_payment/tryton.cfg +++ b/modules/sale_payment/tryton.cfg @@ -12,3 +12,10 @@ extras_depend: xml: sale.xml message.xml + +[register] +model: + ir.Cron + sale.Sale + account.Payment + account.Invoice diff --git a/modules/sale_point/__init__.py b/modules/sale_point/__init__.py index d078caf0ef..4effdfa4a2 100644 --- a/modules/sale_point/__init__.py +++ b/modules/sale_point/__init__.py @@ -1,31 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.modules.sale.sale_reporting import Abstract -from trytond.pool import Pool - -from . import account, product, sale, sale_reporting, stock - - -def register(): - Pool.register( - sale.POS, - sale.POSSale, - sale.POSSaleLine, - sale.POSCashSession, - sale.POSCashSessionRelation, - sale.POSPayment, - sale.POSPaymentMethod, - sale.POSCashTransfer, - sale.POSCashTransferType, - product.Template, - product.Product, - product.GrossPrice, - stock.Move, - account.Move, - account.MoveLine, - module='sale_point', type_='model') - Pool.register( - sale.POSPay, - module='sale_point', type_='wizard') - Pool.register_mixin(sale_reporting.AbstractMixin, Abstract, 'sale_point') diff --git a/modules/sale_point/tryton.cfg b/modules/sale_point/tryton.cfg index 3fcccc8b31..04af364015 100644 --- a/modules/sale_point/tryton.cfg +++ b/modules/sale_point/tryton.cfg @@ -14,3 +14,26 @@ xml: sale.xml product.xml message.xml + +[register] +model: + product.Template + product.Product + product.GrossPrice + stock.Move + account.Move + account.MoveLine + sale.POS + sale.POSSale + sale.POSSaleLine + sale.POSCashSession + sale.POSCashSessionRelation + sale.POSPayment + sale.POSPaymentMethod + sale.POSCashTransfer + sale.POSCashTransferType +wizard: + sale.POSPay + +[register_mixin] +sale_reporting.AbstractMixin: trytond.modules.sale.sale_reporting.Abstract diff --git a/modules/sale_price_list/__init__.py b/modules/sale_price_list/__init__.py index cec58797d2..4effdfa4a2 100644 --- a/modules/sale_price_list/__init__.py +++ b/modules/sale_price_list/__init__.py @@ -1,23 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import configuration, party, product, sale - - -def register(): - Pool.register( - party.Party, - party.PartySalePriceList, - sale.Sale, - sale.Line, - product.Product, - product.PriceList, - product.SaleContext, - configuration.Configuration, - configuration.ConfigurationSalePriceList, - module='sale_price_list', type_='model') - Pool.register( - sale.OpenProduct, - module='sale_price_list', type_='wizard') diff --git a/modules/sale_price_list/tryton.cfg b/modules/sale_price_list/tryton.cfg index be602b1e3a..45b1159621 100644 --- a/modules/sale_price_list/tryton.cfg +++ b/modules/sale_price_list/tryton.cfg @@ -11,3 +11,17 @@ xml: sale.xml configuration.xml product.xml + +[register] +model: + party.Party + party.PartySalePriceList + product.Product + product.PriceList + product.SaleContext + configuration.Configuration + configuration.ConfigurationSalePriceList + sale.Sale + sale.Line +wizard: + sale.OpenProduct diff --git a/modules/sale_product_customer/__init__.py b/modules/sale_product_customer/__init__.py index 3f41c4126d..4effdfa4a2 100644 --- a/modules/sale_product_customer/__init__.py +++ b/modules/sale_product_customer/__init__.py @@ -1,32 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, product, sale, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - product.Template, - product.Product, - product.ProductCustomer, - sale.Line, - account.InvoiceLine, - stock.Move, - module='sale_product_customer', type_='model') - Pool.register( - sale.AmendmentLine, - module='sale_product_customer', type_='model', - depends=['sale_amendment']) - Pool.register( - sale.LineBlanketAgreement, - sale.BlanketAgreementLine, - module='sale_product_customer', type_='model', - depends=['sale_blanket_agreement']) - Pool.register( - module='sale_product_customer', type_='wizard') - Pool.register( - module='sale_product_customer', type_='report') diff --git a/modules/sale_product_customer/tryton.cfg b/modules/sale_product_customer/tryton.cfg index 7e870bce47..2a2138c0db 100644 --- a/modules/sale_product_customer/tryton.cfg +++ b/modules/sale_product_customer/tryton.cfg @@ -12,3 +12,21 @@ extras_depend: xml: product.xml sale.xml + +[register] +model: + product.Template + product.Product + product.ProductCustomer + sale.Line + account.InvoiceLine + stock.Move + +[register sale_amendment] +model: + sale.AmendmentLine + +[register sale_blanket_agreement] +model: + sale.LineBlanketAgreement + sale.BlanketAgreementLine diff --git a/modules/sale_product_quantity/__init__.py b/modules/sale_product_quantity/__init__.py index ec4c098bcf..4effdfa4a2 100644 --- a/modules/sale_product_quantity/__init__.py +++ b/modules/sale_product_quantity/__init__.py @@ -1,19 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product, sale - -__all__ = ['register'] - - -def register(): - Pool.register( - product.Template, - product.Product, - sale.Line, - module='sale_product_quantity', type_='model') - Pool.register( - sale.POSLine, - module='sale_product_quantity', type_='model', depends=['sale_point']) diff --git a/modules/sale_product_quantity/tryton.cfg b/modules/sale_product_quantity/tryton.cfg index a31da205bc..7d20011eeb 100644 --- a/modules/sale_product_quantity/tryton.cfg +++ b/modules/sale_product_quantity/tryton.cfg @@ -7,3 +7,13 @@ depends: xml: product.xml message.xml + +[register] +model: + product.Template + product.Product + sale.Line + +[register sale_point] +model: + sale.POSLine diff --git a/modules/sale_product_recommendation/__init__.py b/modules/sale_product_recommendation/__init__.py index 2afa794f75..4effdfa4a2 100644 --- a/modules/sale_product_recommendation/__init__.py +++ b/modules/sale_product_recommendation/__init__.py @@ -1,22 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product, sale - -__all__ = ['register'] - - -def register(): - Pool.register( - product.Template, - product.Product, - sale.Configuration, - sale.ConfigurationProductRecommendation, - sale.Sale, - module='sale_product_recommendation', type_='model') - Pool.register( - sale.POSSale, - module='sale_product_recommendation', type_='model', - depends=['sale_point']) diff --git a/modules/sale_product_recommendation/tryton.cfg b/modules/sale_product_recommendation/tryton.cfg index d3a954da47..429643cda1 100644 --- a/modules/sale_product_recommendation/tryton.cfg +++ b/modules/sale_product_recommendation/tryton.cfg @@ -9,3 +9,15 @@ extras_depend: xml: product.xml sale.xml + +[register] +model: + product.Template + product.Product + sale.Configuration + sale.ConfigurationProductRecommendation + sale.Sale + +[register sale_point] +model: + sale.POSSale diff --git a/modules/sale_product_recommendation_association_rule/__init__.py b/modules/sale_product_recommendation_association_rule/__init__.py index f477bcfa16..4effdfa4a2 100644 --- a/modules/sale_product_recommendation_association_rule/__init__.py +++ b/modules/sale_product_recommendation_association_rule/__init__.py @@ -1,23 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import ir, sale - -__all__ = ['register'] - - -def register(): - Pool.register( - ir.Cron, - sale.Configuration, - sale.Sale, - sale.ProductAssociationRule, - sale.ProductAssociationRuleAntecedent, - sale.ProductAssociationRuleConsequent, - module='sale_product_recommendation_association_rule', type_='model') - Pool.register( - sale.ProductAssociationRulePOS, - module='sale_product_recommendation_association_rule', type_='model', - depends=['sale_point']) diff --git a/modules/sale_product_recommendation_association_rule/tryton.cfg b/modules/sale_product_recommendation_association_rule/tryton.cfg index 2299970d41..97d67ef9fd 100644 --- a/modules/sale_product_recommendation_association_rule/tryton.cfg +++ b/modules/sale_product_recommendation_association_rule/tryton.cfg @@ -9,3 +9,16 @@ extras_depend: sale_point xml: sale.xml + +[register] +model: + ir.Cron + sale.Configuration + sale.Sale + sale.ProductAssociationRule + sale.ProductAssociationRuleAntecedent + sale.ProductAssociationRuleConsequent + +[register sale_point] +model: + sale.ProductAssociationRulePOS diff --git a/modules/sale_promotion/__init__.py b/modules/sale_promotion/__init__.py index 609af8eeca..4effdfa4a2 100644 --- a/modules/sale_promotion/__init__.py +++ b/modules/sale_promotion/__init__.py @@ -1,17 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import sale, sale_reporting - - -def register(): - Pool.register( - sale.Promotion, - sale.Promotion_Product, - sale.Promotion_ProductCategory, - sale.Sale, - sale.Line, - sale_reporting.Promotion, - module='sale_promotion', type_='model') diff --git a/modules/sale_promotion/tryton.cfg b/modules/sale_promotion/tryton.cfg index 40bebac3ad..23c5ee573d 100644 --- a/modules/sale_promotion/tryton.cfg +++ b/modules/sale_promotion/tryton.cfg @@ -15,3 +15,12 @@ xml: sale.xml sale_reporting.xml message.xml + +[register] +model: + sale.Promotion + sale.Promotion_Product + sale.Promotion_ProductCategory + sale.Sale + sale.Line + sale_reporting.Promotion diff --git a/modules/sale_promotion_coupon/__init__.py b/modules/sale_promotion_coupon/__init__.py index 1be3a33d63..4effdfa4a2 100644 --- a/modules/sale_promotion_coupon/__init__.py +++ b/modules/sale_promotion_coupon/__init__.py @@ -1,22 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import sale - -__all__ = ['register'] - - -def register(): - Pool.register( - sale.Promotion, - sale.PromotionCoupon, - sale.PromotionCouponNumber, - sale.Sale, - sale.Sale_PromotionCouponNumber, - module='sale_promotion_coupon', type_='model') - Pool.register( - module='sale_promotion_coupon', type_='wizard') - Pool.register( - module='sale_promotion_coupon', type_='report') diff --git a/modules/sale_promotion_coupon/tryton.cfg b/modules/sale_promotion_coupon/tryton.cfg index 4347022ab8..45ee8500e9 100644 --- a/modules/sale_promotion_coupon/tryton.cfg +++ b/modules/sale_promotion_coupon/tryton.cfg @@ -8,3 +8,11 @@ depends: xml: sale.xml message.xml + +[register] +model: + sale.Promotion + sale.PromotionCoupon + sale.PromotionCouponNumber + sale.Sale + sale.Sale_PromotionCouponNumber diff --git a/modules/sale_promotion_coupon_payment/__init__.py b/modules/sale_promotion_coupon_payment/__init__.py index a341efebcf..4effdfa4a2 100644 --- a/modules/sale_promotion_coupon_payment/__init__.py +++ b/modules/sale_promotion_coupon_payment/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import sale - -__all__ = ['register'] - - -def register(): - Pool.register( - sale.Sale, - module='sale_promotion_coupon_payment', type_='model') diff --git a/modules/sale_promotion_coupon_payment/tryton.cfg b/modules/sale_promotion_coupon_payment/tryton.cfg index 36f534b366..1328801400 100644 --- a/modules/sale_promotion_coupon_payment/tryton.cfg +++ b/modules/sale_promotion_coupon_payment/tryton.cfg @@ -4,4 +4,7 @@ depends: account_payment ir sale_promotion_coupon -xml: + +[register] +model: + sale.Sale diff --git a/modules/sale_secondary_unit/__init__.py b/modules/sale_secondary_unit/__init__.py index ae028028ea..4effdfa4a2 100644 --- a/modules/sale_secondary_unit/__init__.py +++ b/modules/sale_secondary_unit/__init__.py @@ -1,36 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, product, sale, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - account.InvoiceLine, - product.Template, - product.Product, - sale.Line, - stock.Move, - module='sale_secondary_unit', type_='model') - Pool.register( - product.ProductCustomer, - sale.Line_ProductCustomer, - module='sale_secondary_unit', type_='model', - depends=['sale_product_customer']) - Pool.register( - sale.OpportunityLine, - module='sale_secondary_unit', type_='model', - depends=['sale_opportunity']) - Pool.register( - sale.BlanketAgreementLine, - sale.LineBlanketAgreement, - module='sale_secondary_unit', type_='model', - depends=['sale_blanket_agreement']) - Pool.register( - sale.AmendmentLine, - module='sale_secondary_unit', type_='model', - depends=['sale_amendment']) diff --git a/modules/sale_secondary_unit/tryton.cfg b/modules/sale_secondary_unit/tryton.cfg index 79481c90cf..fb682b3513 100644 --- a/modules/sale_secondary_unit/tryton.cfg +++ b/modules/sale_secondary_unit/tryton.cfg @@ -18,3 +18,29 @@ xml: sale.xml stock.xml message.xml + +[register] +model: + product.Template + product.Product + account.InvoiceLine + stock.Move + sale.Line + +[register sale_amendment] +model: + sale.AmendmentLine + +[register sale_blanket_agreement] +model: + sale.BlanketAgreementLine + sale.LineBlanketAgreement + +[register sale_opportunity] +model: + sale.OpportunityLine + +[register sale_product_customer] +model: + product.ProductCustomer + sale.Line_ProductCustomer diff --git a/modules/sale_shipment_cost/__init__.py b/modules/sale_shipment_cost/__init__.py index 184f092bc8..93a275f648 100644 --- a/modules/sale_shipment_cost/__init__.py +++ b/modules/sale_shipment_cost/__init__.py @@ -1,30 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import account, party, sale, stock -from .stock import ShipmentCostSaleMixin - -__all__ = ['register', 'ShipmentCostSaleMixin'] +__all__ = ['ShipmentCostSaleMixin'] -def register(): - Pool.register( - party.Party, - party.PartySaleMethod, - account.InvoiceLine, - sale.Configuration, - sale.ConfigurationSaleMethod, - sale.Sale, - sale.Line, - stock.ShipmentCostSale, - stock.ShipmentOut, - module='sale_shipment_cost', type_='model') - Pool.register( - sale.Promotion, - module='sale_shipment_cost', type_='model', - depends=['sale_promotion']) - Pool.register( - sale.ReturnSale, - module='sale_shipment_cost', type_='wizard') +def __getattr__(name): + if name == 'ShipmentCostSaleMixin': + from .stock import ShipmentCostSaleMixin + return ShipmentCostSaleMixin + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/sale_shipment_cost/tryton.cfg b/modules/sale_shipment_cost/tryton.cfg index 9e932250a1..038546ff76 100644 --- a/modules/sale_shipment_cost/tryton.cfg +++ b/modules/sale_shipment_cost/tryton.cfg @@ -18,3 +18,21 @@ xml: sale.xml stock.xml message.xml + +[register] +model: + party.Party + party.PartySaleMethod + account.InvoiceLine + sale.Configuration + sale.ConfigurationSaleMethod + sale.Sale + sale.Line + stock.ShipmentCostSale + stock.ShipmentOut +wizard: + sale.ReturnSale + +[register sale_promotion] +model: + sale.Promotion diff --git a/modules/sale_shipment_grouping/__init__.py b/modules/sale_shipment_grouping/__init__.py index f1613347d3..4effdfa4a2 100644 --- a/modules/sale_shipment_grouping/__init__.py +++ b/modules/sale_shipment_grouping/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import configuration, party, sale - - -def register(): - Pool.register( - party.Party, - party.PartySaleShipmentGroupingMethod, - sale.Sale, - configuration.Configuration, - configuration.ConfigurationSaleMethod, - module='sale_shipment_grouping', type_='model') diff --git a/modules/sale_shipment_grouping/tryton.cfg b/modules/sale_shipment_grouping/tryton.cfg index 605295e48a..fa7ae126ee 100644 --- a/modules/sale_shipment_grouping/tryton.cfg +++ b/modules/sale_shipment_grouping/tryton.cfg @@ -9,3 +9,11 @@ depends: xml: party.xml configuration.xml + +[register] +model: + party.Party + party.PartySaleShipmentGroupingMethod + configuration.Configuration + configuration.ConfigurationSaleMethod + sale.Sale diff --git a/modules/sale_shipment_tolerance/__init__.py b/modules/sale_shipment_tolerance/__init__.py index 12eba5c311..4effdfa4a2 100644 --- a/modules/sale_shipment_tolerance/__init__.py +++ b/modules/sale_shipment_tolerance/__init__.py @@ -1,17 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import configuration, sale, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - configuration.Configuration, - configuration.ConfigurationShipmentTolerance, - sale.Line, - stock.Move, - module='sale_shipment_tolerance', type_='model') diff --git a/modules/sale_shipment_tolerance/tryton.cfg b/modules/sale_shipment_tolerance/tryton.cfg index 95073fec6f..538e7b36b1 100644 --- a/modules/sale_shipment_tolerance/tryton.cfg +++ b/modules/sale_shipment_tolerance/tryton.cfg @@ -7,3 +7,10 @@ depends: xml: configuration.xml message.xml + +[register] +model: + configuration.Configuration + configuration.ConfigurationShipmentTolerance + sale.Line + stock.Move diff --git a/modules/sale_stock_quantity/__init__.py b/modules/sale_stock_quantity/__init__.py index 67c6dac9de..4effdfa4a2 100644 --- a/modules/sale_stock_quantity/__init__.py +++ b/modules/sale_stock_quantity/__init__.py @@ -1,13 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import sale - - -def register(): - Pool.register( - sale.Sale, - sale.Line, - module='sale_stock_quantity', type_='model') diff --git a/modules/sale_stock_quantity/tryton.cfg b/modules/sale_stock_quantity/tryton.cfg index 82efbf46de..4a422c1794 100644 --- a/modules/sale_stock_quantity/tryton.cfg +++ b/modules/sale_stock_quantity/tryton.cfg @@ -10,3 +10,8 @@ extras_depend: xml: sale.xml message.xml + +[register] +model: + sale.Sale + sale.Line diff --git a/modules/sale_subscription/__init__.py b/modules/sale_subscription/__init__.py index dc839dd693..4effdfa4a2 100644 --- a/modules/sale_subscription/__init__.py +++ b/modules/sale_subscription/__init__.py @@ -1,37 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import ( - configuration, invoice, ir, party, product, recurrence, service, - subscription) - - -def register(): - Pool.register( - configuration.Configuration, - configuration.ConfigurationSequence, - recurrence.RecurrenceRuleSet, - recurrence.RecurrenceRule, - recurrence.TestRecurrenceRuleSetView, - recurrence.TestRecurrenceRuleSetViewResult, - service.Service, - subscription.Subscription, - subscription.Line, - subscription.LineConsumption, - subscription.CreateLineConsumptionStart, - subscription.CreateSubscriptionInvoiceStart, - invoice.InvoiceLine, - product.Product, - ir.Cron, - module='sale_subscription', type_='model') - Pool.register( - subscription.CreateLineConsumption, - subscription.CreateSubscriptionInvoice, - recurrence.TestRecurrenceRuleSet, - party.Replace, - party.Erase, - module='sale_subscription', type_='wizard') - Pool.register( - module='sale_subscription', type_='report') diff --git a/modules/sale_subscription/tryton.cfg b/modules/sale_subscription/tryton.cfg index 490ff2d871..3fc35191c9 100644 --- a/modules/sale_subscription/tryton.cfg +++ b/modules/sale_subscription/tryton.cfg @@ -17,3 +17,27 @@ xml: party.xml product.xml message.xml + +[register] +model: + ir.Cron + product.Product + configuration.Configuration + configuration.ConfigurationSequence + recurrence.RecurrenceRuleSet + recurrence.RecurrenceRule + recurrence.TestRecurrenceRuleSetView + recurrence.TestRecurrenceRuleSetViewResult + service.Service + subscription.Subscription + subscription.Line + subscription.LineConsumption + subscription.CreateLineConsumptionStart + subscription.CreateSubscriptionInvoiceStart + invoice.InvoiceLine +wizard: + party.Replace + party.Erase + subscription.CreateLineConsumption + subscription.CreateSubscriptionInvoice + recurrence.TestRecurrenceRuleSet diff --git a/modules/sale_subscription_asset/__init__.py b/modules/sale_subscription_asset/__init__.py index 89354206d8..4effdfa4a2 100644 --- a/modules/sale_subscription_asset/__init__.py +++ b/modules/sale_subscription_asset/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import sale, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - sale.SubscriptionServiceStockLot, - sale.SubscriptionService, - sale.Subscription, - sale.SubscriptionLine, - stock.Lot, - module='sale_subscription_asset', type_='model') diff --git a/modules/sale_subscription_asset/tryton.cfg b/modules/sale_subscription_asset/tryton.cfg index c3384ac7b9..85ae34261b 100644 --- a/modules/sale_subscription_asset/tryton.cfg +++ b/modules/sale_subscription_asset/tryton.cfg @@ -8,3 +8,11 @@ xml: sale.xml stock.xml message.xml + +[register] +model: + stock.Lot + sale.SubscriptionServiceStockLot + sale.SubscriptionService + sale.Subscription + sale.SubscriptionLine diff --git a/modules/sale_supply/__init__.py b/modules/sale_supply/__init__.py index 3761891064..4effdfa4a2 100644 --- a/modules/sale_supply/__init__.py +++ b/modules/sale_supply/__init__.py @@ -1,20 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product, purchase, sale, stock - - -def register(): - Pool.register( - sale.Sale, - sale.Line, - purchase.Request, - stock.ShipmentIn, - product.Template, - product.Product, - module='sale_supply', type_='model') - Pool.register( - stock.OrderPoint, - module='sale_supply', type_='model', depends=['stock_supply']) diff --git a/modules/sale_supply/tryton.cfg b/modules/sale_supply/tryton.cfg index 251e3219cb..19b393b1e7 100644 --- a/modules/sale_supply/tryton.cfg +++ b/modules/sale_supply/tryton.cfg @@ -12,3 +12,16 @@ xml: product.xml sale.xml message.xml + +[register] +model: + product.Template + product.Product + sale.Sale + sale.Line + purchase.Request + stock.ShipmentIn + +[register stock_supply] +model: + stock.OrderPoint diff --git a/modules/sale_supply_drop_shipment/__init__.py b/modules/sale_supply_drop_shipment/__init__.py index 430a7a72ac..4effdfa4a2 100644 --- a/modules/sale_supply_drop_shipment/__init__.py +++ b/modules/sale_supply_drop_shipment/__init__.py @@ -1,45 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import party, product, purchase, sale, stock - - -def register(): - Pool.register( - stock.Configuration, - stock.ConfigurationSequence, - stock.Move, - stock.ShipmentDrop, - sale.Configuration, - sale.ConfigurationSaleDropLocation, - sale.Sale, - sale.Line, - purchase.Request, - purchase.Configuration, - purchase.ConfigurationPurchaseDropLocation, - purchase.Purchase, - purchase.Line, - purchase.ProductSupplier, - product.Product, - module='sale_supply_drop_shipment', type_='model') - Pool.register( - purchase.RequestCreatePurchase, - purchase.HandleShipmentException, - party.Replace, - party.Erase, - module='sale_supply_drop_shipment', type_='wizard') - Pool.register( - sale.Amendment, - module='sale_supply_drop_shipment', type_='model', - depends=['sale_amendment']) - Pool.register( - stock.ShipmentDropSplit, - stock.MoveSplit, - module='sale_supply_drop_shipment', type_='model', - depends=['stock_split']) - Pool.register( - stock.SplitShipment, - module='sale_supply_drop_shipment', type_='wizard', - depends=['stock_split']) diff --git a/modules/sale_supply_drop_shipment/tryton.cfg b/modules/sale_supply_drop_shipment/tryton.cfg index d57e27a184..5606902deb 100644 --- a/modules/sale_supply_drop_shipment/tryton.cfg +++ b/modules/sale_supply_drop_shipment/tryton.cfg @@ -18,3 +18,37 @@ xml: purchase.xml party.xml message.xml + +[register] +model: + product.Product + stock.Configuration + stock.ConfigurationSequence + stock.Move + stock.ShipmentDrop + sale.Configuration + sale.ConfigurationSaleDropLocation + sale.Sale + sale.Line + purchase.Request + purchase.Configuration + purchase.ConfigurationPurchaseDropLocation + purchase.Purchase + purchase.Line + purchase.ProductSupplier +wizard: + party.Replace + party.Erase + purchase.RequestCreatePurchase + purchase.HandleShipmentException + +[register sale_amendment] +model: + sale.Amendment + +[register stock_split] +model: + stock.ShipmentDropSplit + stock.MoveSplit +wizard: + stock.SplitShipment diff --git a/modules/sale_supply_production/__init__.py b/modules/sale_supply_production/__init__.py index bdc0c92436..4effdfa4a2 100644 --- a/modules/sale_supply_production/__init__.py +++ b/modules/sale_supply_production/__init__.py @@ -1,26 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product, production, sale - -__all__ = ['register'] - - -def register(): - Pool.register( - product.Template, - product.Product, - production.Production, - sale.Sale, - sale.Line, - module='sale_supply_production', type_='model') - Pool.register( - module='sale_supply_production', type_='wizard') - Pool.register( - module='sale_supply_production', type_='report') - Pool.register( - sale.Line_Routing, - module='sale_supply_production', type_='model', - depends=['production_routing']) diff --git a/modules/sale_supply_production/tryton.cfg b/modules/sale_supply_production/tryton.cfg index 5e981a9960..9f527dcabf 100644 --- a/modules/sale_supply_production/tryton.cfg +++ b/modules/sale_supply_production/tryton.cfg @@ -8,3 +8,15 @@ xml: sale.xml product.xml message.xml + +[register] +model: + product.Template + product.Product + production.Production + sale.Sale + sale.Line + +[register production_routing] +model: + sale.Line_Routing diff --git a/modules/stock/__init__.py b/modules/stock/__init__.py index 32260e7c5b..7aac3c40e7 100644 --- a/modules/stock/__init__.py +++ b/modules/stock/__init__.py @@ -1,78 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import ( - configuration, inventory, ir, location, move, party, period, product, res, - shipment, stock_reporting_margin) -from .move import StockMixin - -__all__ = ['StockMixin', 'register'] +__all__ = ['StockMixin'] -def register(): - Pool.register( - location.Location, - location.WarehouseWasteLocation, - location.ProductsByLocationsContext, - location.ProductsByLocations, - location.LocationLeadTime, - move.Move, - shipment.ShipmentIn, - shipment.ShipmentInReturn, - shipment.ShipmentOut, - shipment.ShipmentOutReturn, - shipment.ShipmentInternal, - shipment.AssignPartial, - party.Party, - party.PartyLocation, - party.PartyDeliveredToWarehouse, - party.Address, - party.ContactMechanism, - period.Period, - period.Cache, - product.Template, - product.Product, - product.ProductByLocationContext, - product.ProductQuantitiesByWarehouse, - product.ProductQuantitiesByWarehouseContext, - product.ProductQuantitiesByWarehouseMove, - product.RecomputeCostPriceStart, - product.CostPriceRevision, - product.ModifyCostPriceStart, - inventory.Inventory, - inventory.InventoryLine, - inventory.CountSearch, - inventory.CountQuantity, - configuration.Configuration, - configuration.ConfigurationSequence, - configuration.ConfigurationLocation, - ir.Cron, - res.User, - stock_reporting_margin.Context, - stock_reporting_margin.Main, - stock_reporting_margin.MainTimeseries, - stock_reporting_margin.Product, - stock_reporting_margin.ProductTimeseries, - stock_reporting_margin.Category, - stock_reporting_margin.CategoryTimeseries, - stock_reporting_margin.CategoryTree, - module='stock', type_='model') - Pool.register( - shipment.Assign, - product.OpenProductQuantitiesByWarehouse, - product.OpenProductQuantitiesByWarehouseMove, - product.RecomputeCostPrice, - product.ModifyCostPrice, - inventory.Count, - party.Replace, - party.Erase, - module='stock', type_='wizard') - Pool.register( - shipment.DeliveryNote, - shipment.PickingList, - shipment.SupplierRestockingList, - shipment.CustomerReturnRestockingList, - shipment.InteralShipmentReport, - module='stock', type_='report') +def __getattr__(name): + if name == 'StockMixin': + from .move import StockMixin + return StockMixin + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/stock/tryton.cfg b/modules/stock/tryton.cfg index 74d74328eb..ff115ad24d 100644 --- a/modules/stock/tryton.cfg +++ b/modules/stock/tryton.cfg @@ -20,3 +20,66 @@ xml: message.xml res.xml stock_reporting_margin.xml + +[register] +model: + ir.Cron + res.User + party.Party + party.PartyLocation + party.PartyDeliveredToWarehouse + party.Address + party.ContactMechanism + product.Template + product.Product + product.ProductByLocationContext + product.ProductQuantitiesByWarehouse + product.ProductQuantitiesByWarehouseContext + product.ProductQuantitiesByWarehouseMove + product.RecomputeCostPriceStart + product.CostPriceRevision + product.ModifyCostPriceStart + configuration.Configuration + configuration.ConfigurationSequence + configuration.ConfigurationLocation + location.Location + location.WarehouseWasteLocation + location.ProductsByLocationsContext + location.ProductsByLocations + location.LocationLeadTime + move.Move + shipment.ShipmentIn + shipment.ShipmentInReturn + shipment.ShipmentOut + shipment.ShipmentOutReturn + shipment.ShipmentInternal + shipment.AssignPartial + period.Period + period.Cache + inventory.Inventory + inventory.InventoryLine + inventory.CountSearch + inventory.CountQuantity + stock_reporting_margin.Context + stock_reporting_margin.Main + stock_reporting_margin.MainTimeseries + stock_reporting_margin.Product + stock_reporting_margin.ProductTimeseries + stock_reporting_margin.Category + stock_reporting_margin.CategoryTimeseries + stock_reporting_margin.CategoryTree +wizard: + party.Replace + party.Erase + product.OpenProductQuantitiesByWarehouse + product.OpenProductQuantitiesByWarehouseMove + product.RecomputeCostPrice + product.ModifyCostPrice + shipment.Assign + inventory.Count +report: + shipment.DeliveryNote + shipment.PickingList + shipment.SupplierRestockingList + shipment.CustomerReturnRestockingList + shipment.InteralShipmentReport diff --git a/modules/stock_assign_manual/__init__.py b/modules/stock_assign_manual/__init__.py index 58852a5380..4effdfa4a2 100644 --- a/modules/stock_assign_manual/__init__.py +++ b/modules/stock_assign_manual/__init__.py @@ -1,26 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import production, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - stock.ShipmentInReturn, - stock.ShipmentOut, - stock.ShipmentInternal, - stock.ShipmentAssignedMove, - stock.ShipmentAssignManualShow, - stock.ShipmentUnassignManualShow, - module='stock_assign_manual', type_='model') - Pool.register( - stock.ShipmentAssignManual, - stock.ShipmentUnassignManual, - module='stock_assign_manual', type_='wizard') - Pool.register( - production.Production, - module='stock_assign_manual', type_='model', depends=['production']) diff --git a/modules/stock_assign_manual/tryton.cfg b/modules/stock_assign_manual/tryton.cfg index 50363bbb4b..a95cd56490 100644 --- a/modules/stock_assign_manual/tryton.cfg +++ b/modules/stock_assign_manual/tryton.cfg @@ -9,3 +9,19 @@ xml: stock.xml production.xml message.xml + +[register] +model: + stock.ShipmentInReturn + stock.ShipmentOut + stock.ShipmentInternal + stock.ShipmentAssignedMove + stock.ShipmentAssignManualShow + stock.ShipmentUnassignManualShow +wizard: + stock.ShipmentAssignManual + stock.ShipmentUnassignManual + +[register production] +model: + production.Production diff --git a/modules/stock_consignment/__init__.py b/modules/stock_consignment/__init__.py index da59c8f037..4effdfa4a2 100644 --- a/modules/stock_consignment/__init__.py +++ b/modules/stock_consignment/__init__.py @@ -1,23 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import account, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - stock.Location, - stock.LocationLeadTime, - stock.Move, - stock.ShipmentInternal, - stock.Inventory, - account.InvoiceLine, - module='stock_consignment', type_='model') - Pool.register( - stock.OrderPoint, - module='stock_consignment', type_='model', - depends=['stock_supply']) diff --git a/modules/stock_consignment/tryton.cfg b/modules/stock_consignment/tryton.cfg index 4699b31dbd..987f66f319 100644 --- a/modules/stock_consignment/tryton.cfg +++ b/modules/stock_consignment/tryton.cfg @@ -13,3 +13,16 @@ extras_depend: stock_supply xml: stock.xml + +[register] +model: + stock.Location + stock.LocationLeadTime + stock.Move + stock.ShipmentInternal + stock.Inventory + account.InvoiceLine + +[register stock_supply] +model: + stock.OrderPoint diff --git a/modules/stock_forecast/__init__.py b/modules/stock_forecast/__init__.py index f5efa3415b..4effdfa4a2 100644 --- a/modules/stock_forecast/__init__.py +++ b/modules/stock_forecast/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import forecast, stock - - -def register(): - Pool.register( - stock.Move, - forecast.Forecast, - forecast.ForecastLine, - forecast.ForecastCompleteAsk, - module='stock_forecast', type_='model') - Pool.register( - forecast.ForecastComplete, - module='stock_forecast', type_='wizard') diff --git a/modules/stock_forecast/tryton.cfg b/modules/stock_forecast/tryton.cfg index 3720a8ab90..0fdde1990d 100644 --- a/modules/stock_forecast/tryton.cfg +++ b/modules/stock_forecast/tryton.cfg @@ -10,3 +10,12 @@ xml: product.xml forecast.xml message.xml + +[register] +model: + stock.Move + forecast.Forecast + forecast.ForecastLine + forecast.ForecastCompleteAsk +wizard: + forecast.ForecastComplete diff --git a/modules/stock_inventory_location/__init__.py b/modules/stock_inventory_location/__init__.py index f6753b9ddc..4effdfa4a2 100644 --- a/modules/stock_inventory_location/__init__.py +++ b/modules/stock_inventory_location/__init__.py @@ -1,15 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import inventory - - -def register(): - Pool.register( - inventory.CreateInventoriesStart, - module='stock_inventory_location', type_='model') - Pool.register( - inventory.CreateInventories, - module='stock_inventory_location', type_='wizard') diff --git a/modules/stock_inventory_location/tryton.cfg b/modules/stock_inventory_location/tryton.cfg index b4a0865055..a37f9e83cf 100644 --- a/modules/stock_inventory_location/tryton.cfg +++ b/modules/stock_inventory_location/tryton.cfg @@ -7,3 +7,9 @@ depends: stock xml: inventory.xml + +[register] +model: + inventory.CreateInventoriesStart +wizard: + inventory.CreateInventories diff --git a/modules/stock_location_move/__init__.py b/modules/stock_location_move/__init__.py index 607de67820..4effdfa4a2 100644 --- a/modules/stock_location_move/__init__.py +++ b/modules/stock_location_move/__init__.py @@ -1,25 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - stock.Location, - stock.ShipmentInternal, - stock.ShipmentInternal_Location, - stock.ShipmentOut, - stock.ShipmentInReturn, - product.Product, - module='stock_location_move', type_='model') - Pool.register( - stock.Supply, - module='stock_location_move', type_='wizard', - depends=['stock_supply']) - Pool.register( - module='stock_location_move', type_='report') diff --git a/modules/stock_location_move/tryton.cfg b/modules/stock_location_move/tryton.cfg index 6dd8b1ae08..20f3cc569d 100644 --- a/modules/stock_location_move/tryton.cfg +++ b/modules/stock_location_move/tryton.cfg @@ -8,3 +8,16 @@ extras_depend: xml: stock.xml message.xml + +[register] +model: + product.Product + stock.Location + stock.ShipmentInternal + stock.ShipmentInternal_Location + stock.ShipmentOut + stock.ShipmentInReturn + +[register stock_supply] +wizard: + stock.Supply diff --git a/modules/stock_location_sequence/__init__.py b/modules/stock_location_sequence/__init__.py index edaacbf806..4effdfa4a2 100644 --- a/modules/stock_location_sequence/__init__.py +++ b/modules/stock_location_sequence/__init__.py @@ -1,12 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import stock - - -def register(): - Pool.register( - stock.Location, - module='stock_location_sequence', type_='model') diff --git a/modules/stock_location_sequence/tryton.cfg b/modules/stock_location_sequence/tryton.cfg index c543f48b76..22a6797512 100644 --- a/modules/stock_location_sequence/tryton.cfg +++ b/modules/stock_location_sequence/tryton.cfg @@ -5,3 +5,7 @@ depends: stock xml: stock.xml + +[register] +model: + stock.Location diff --git a/modules/stock_lot/__init__.py b/modules/stock_lot/__init__.py index 72474b15fc..ca32410941 100644 --- a/modules/stock_lot/__init__.py +++ b/modules/stock_lot/__init__.py @@ -1,44 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import product, stock -from .stock import LotMixin - -__all__ = ['LotMixin', 'register'] +__all__ = ['LotMixin'] -def register(): - Pool.register( - stock.Lot, - stock.LotTrace, - stock.LotByLocationContext, - stock.LotsByLocations, - stock.Location, - stock.Move, - stock.MoveAddLotsStart, - stock.MoveAddLotsStartLot, - stock.ShipmentIn, - stock.ShipmentOut, - stock.ShipmentOutReturn, - stock.ShipmentInternal, - stock.Period, - stock.PeriodCacheLot, - stock.Inventory, - stock.InventoryLine, - stock.InventoryCountSearch, - stock.InventoryCountQuantity, - product.Configuration, - product.ConfigurationDefaultLotSequence, - product.Template, - product.Product, - module='stock_lot', type_='model') - Pool.register( - stock.MoveAddLots, - stock.InventoryCount, - module='stock_lot', type_='wizard') - Pool.register( - stock.ShipmentDrop, - module='stock_lot', type_='model', - depends=['sale_supply_drop_shipment']) +def __getattr__(name): + if name == 'LotMixin': + from .stock import LotMixin + return LotMixin + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/stock_lot/tryton.cfg b/modules/stock_lot/tryton.cfg index 0ccf702727..b8091a3fe4 100644 --- a/modules/stock_lot/tryton.cfg +++ b/modules/stock_lot/tryton.cfg @@ -12,3 +12,35 @@ xml: stock.xml product.xml message.xml + +[register] +model: + product.Configuration + product.ConfigurationDefaultLotSequence + product.Template + product.Product + stock.Lot + stock.LotTrace + stock.LotByLocationContext + stock.LotsByLocations + stock.Location + stock.Move + stock.MoveAddLotsStart + stock.MoveAddLotsStartLot + stock.ShipmentIn + stock.ShipmentOut + stock.ShipmentOutReturn + stock.ShipmentInternal + stock.Period + stock.PeriodCacheLot + stock.Inventory + stock.InventoryLine + stock.InventoryCountSearch + stock.InventoryCountQuantity +wizard: + stock.MoveAddLots + stock.InventoryCount + +[register sale_supply_drop_shipment] +model: + stock.ShipmentDrop diff --git a/modules/stock_lot_sled/__init__.py b/modules/stock_lot_sled/__init__.py index b1582f7353..b52960d961 100644 --- a/modules/stock_lot_sled/__init__.py +++ b/modules/stock_lot_sled/__init__.py @@ -1,22 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import product, stock -from .stock import LotSledMixin - -__all__ = ['LotSledMixin', 'register'] +__all__ = ['LotSledMixin'] -def register(): - Pool.register( - product.Template, - product.Product, - stock.Configuration, - stock.ConfigurationLotShelfLife, - stock.Lot, - stock.MoveAddLotsStartLot, - stock.Move, - stock.Period, - module='stock_lot_sled', type_='model') +def __getattr__(name): + if name == 'LotSledMixin': + from .stock import LotSledMixin + return LotSledMixin + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/stock_lot_sled/tryton.cfg b/modules/stock_lot_sled/tryton.cfg index c1ab2d73d2..69094f1352 100644 --- a/modules/stock_lot_sled/tryton.cfg +++ b/modules/stock_lot_sled/tryton.cfg @@ -9,3 +9,14 @@ xml: stock.xml product.xml message.xml + +[register] +model: + product.Template + product.Product + stock.Configuration + stock.ConfigurationLotShelfLife + stock.Lot + stock.MoveAddLotsStartLot + stock.Move + stock.Period diff --git a/modules/stock_lot_unit/__init__.py b/modules/stock_lot_unit/__init__.py index 124ac6867c..ff13432b8b 100644 --- a/modules/stock_lot_unit/__init__.py +++ b/modules/stock_lot_unit/__init__.py @@ -1,31 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - -from . import product, stock -from .stock import LotUnitMixin - -__all__ = ['LotUnitMixin', 'register'] +__all__ = ['LotUnitMixin'] -def register(): - Pool.register( - product.Template, - product.Product, - stock.Lot, - stock.MoveAddLotsStartLot, - stock.Move, - stock.Inventory, - stock.ShipmentIn, - stock.ShipmentInReturn, - stock.ShipmentOut, - stock.ShipmentOutReturn, - module='stock_lot_unit', type_='model') - Pool.register( - stock.Production, - module='stock_lot_unit', type_='model', - depends=['production']) - Pool.register( - stock.InventoryCount, - module='stock_lot_unit', type_='wizard') +def __getattr__(name): + if name == 'LotUnitMixin': + from .stock import LotUnitMixin + return LotUnitMixin + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/stock_lot_unit/tryton.cfg b/modules/stock_lot_unit/tryton.cfg index c60574359f..cdfad809e0 100644 --- a/modules/stock_lot_unit/tryton.cfg +++ b/modules/stock_lot_unit/tryton.cfg @@ -12,3 +12,22 @@ xml: product.xml stock.xml message.xml + +[register] +model: + product.Template + product.Product + stock.Lot + stock.MoveAddLotsStartLot + stock.Move + stock.Inventory + stock.ShipmentIn + stock.ShipmentInReturn + stock.ShipmentOut + stock.ShipmentOutReturn +wizard: + stock.InventoryCount + +[register production] +model: + stock.Production diff --git a/modules/stock_package/__init__.py b/modules/stock_package/__init__.py index bf49c95aca..4effdfa4a2 100644 --- a/modules/stock_package/__init__.py +++ b/modules/stock_package/__init__.py @@ -1,19 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import stock - - -def register(): - Pool.register( - stock.Configuration, - stock.ConfigurationSequence, - stock.Type, - stock.Package, - stock.Move, - stock.ShipmentOut, - stock.ShipmentInReturn, - stock.ShipmentInternal, - module='stock_package', type_='model') diff --git a/modules/stock_package/tryton.cfg b/modules/stock_package/tryton.cfg index 173911c906..dacd633944 100644 --- a/modules/stock_package/tryton.cfg +++ b/modules/stock_package/tryton.cfg @@ -11,3 +11,14 @@ extras_depend: xml: stock.xml message.xml + +[register] +model: + stock.Configuration + stock.ConfigurationSequence + stock.Type + stock.Package + stock.Move + stock.ShipmentOut + stock.ShipmentInReturn + stock.ShipmentInternal diff --git a/modules/stock_package_shipping/__init__.py b/modules/stock_package_shipping/__init__.py index 4d49fe2b06..4effdfa4a2 100644 --- a/modules/stock_package_shipping/__init__.py +++ b/modules/stock_package_shipping/__init__.py @@ -1,23 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import carrier, stock - - -def register(): - Pool.register( - stock.Package, - stock.ShipmentOut, - stock.ShipmentInReturn, - stock.ShipmentInternal, - carrier.Carrier, - module='stock_package_shipping', type_='model') - Pool.register( - stock.CreateShipping, - stock.PrintShippingLabel, - module='stock_package_shipping', type_='wizard') - Pool.register( - stock.ShippingLabel, - module='stock_package_shipping', type_='report') diff --git a/modules/stock_package_shipping/tryton.cfg b/modules/stock_package_shipping/tryton.cfg index 0cf95868aa..e58489c163 100644 --- a/modules/stock_package_shipping/tryton.cfg +++ b/modules/stock_package_shipping/tryton.cfg @@ -14,3 +14,16 @@ xml: carrier.xml stock.xml message.xml + +[register] +model: + carrier.Carrier + stock.Package + stock.ShipmentOut + stock.ShipmentInReturn + stock.ShipmentInternal +wizard: + stock.CreateShipping + stock.PrintShippingLabel +report: + stock.ShippingLabel diff --git a/modules/stock_package_shipping_dpd/__init__.py b/modules/stock_package_shipping_dpd/__init__.py index d7b2c693e9..4effdfa4a2 100644 --- a/modules/stock_package_shipping_dpd/__init__.py +++ b/modules/stock_package_shipping_dpd/__init__.py @@ -1,22 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.modules.stock_package_shipping.stock import ShippingMixin -from trytond.pool import Pool - -from . import carrier, stock - - -def register(): - Pool.register( - carrier.CredentialDPD, - carrier.Carrier, - stock.Package, - module='stock_package_shipping_dpd', type_='model') - Pool.register( - stock.CreateShipping, - stock.CreateDPDShipping, - module='stock_package_shipping_dpd', type_='wizard') - Pool.register_mixin( - stock.ShippingDPDMixin, ShippingMixin, - module='stock_package_shipping_dpd') diff --git a/modules/stock_package_shipping_dpd/tryton.cfg b/modules/stock_package_shipping_dpd/tryton.cfg index 6c26ab3339..69a8f8b544 100644 --- a/modules/stock_package_shipping_dpd/tryton.cfg +++ b/modules/stock_package_shipping_dpd/tryton.cfg @@ -13,3 +13,15 @@ xml: carrier.xml stock.xml message.xml + +[register] +model: + carrier.CredentialDPD + carrier.Carrier + stock.Package +wizard: + stock.CreateShipping + stock.CreateDPDShipping + +[register_mixin] +stock.ShippingDPDMixin: trytond.modules.stock_package_shipping.stock.ShippingMixin diff --git a/modules/stock_package_shipping_mygls/__init__.py b/modules/stock_package_shipping_mygls/__init__.py index 4d3c1ade6b..4effdfa4a2 100644 --- a/modules/stock_package_shipping_mygls/__init__.py +++ b/modules/stock_package_shipping_mygls/__init__.py @@ -1,24 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.modules.stock_package_shipping.stock import ShippingMixin -from trytond.pool import Pool - -from . import carrier, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - carrier.CredentialMyGLS, - carrier.Carrier, - stock.Package, - module='stock_package_shipping_mygls', type_='model') - Pool.register( - stock.ShipmentCreateShipping, - stock.ShipmentCreateShippingMyGLS, - module='stock_package_shipping_mygls', type_='wizard') - Pool.register_mixin( - stock.ShippingMyGLSMixin, ShippingMixin, - module='stock_package_shipping_mygls') diff --git a/modules/stock_package_shipping_mygls/tryton.cfg b/modules/stock_package_shipping_mygls/tryton.cfg index cbb26fbe70..0933b1f9fd 100644 --- a/modules/stock_package_shipping_mygls/tryton.cfg +++ b/modules/stock_package_shipping_mygls/tryton.cfg @@ -10,3 +10,15 @@ xml: carrier.xml stock.xml message.xml + +[register] +model: + carrier.CredentialMyGLS + carrier.Carrier + stock.Package +wizard: + stock.ShipmentCreateShipping + stock.ShipmentCreateShippingMyGLS + +[register_mixin] +stock.ShippingMyGLSMixin: trytond.modules.stock_package_shipping.stock.ShippingMixin diff --git a/modules/stock_package_shipping_sendcloud/__init__.py b/modules/stock_package_shipping_sendcloud/__init__.py index 594a6dd28a..4effdfa4a2 100644 --- a/modules/stock_package_shipping_sendcloud/__init__.py +++ b/modules/stock_package_shipping_sendcloud/__init__.py @@ -1,26 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.modules.stock_package_shipping.stock import ShippingMixin -from trytond.pool import Pool - -from . import carrier, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - carrier.CredentialSendcloud, - carrier.SendcloudAddress, - carrier.SendcloudShippingMethod, - carrier.Carrier, - stock.Package, - module='stock_package_shipping_sendcloud', type_='model') - Pool.register( - stock.CreateShipping, - stock.CreateShippingSendcloud, - module='stock_package_shipping_sendcloud', type_='wizard') - Pool.register_mixin( - stock.ShippingSendcloudMixin, ShippingMixin, - module='stock_package_shipping_sendcloud') diff --git a/modules/stock_package_shipping_sendcloud/tryton.cfg b/modules/stock_package_shipping_sendcloud/tryton.cfg index 4ea4239740..938905d699 100644 --- a/modules/stock_package_shipping_sendcloud/tryton.cfg +++ b/modules/stock_package_shipping_sendcloud/tryton.cfg @@ -14,3 +14,17 @@ xml: carrier.xml stock.xml message.xml + +[register] +model: + carrier.CredentialSendcloud + carrier.SendcloudAddress + carrier.SendcloudShippingMethod + carrier.Carrier + stock.Package +wizard: + stock.CreateShipping + stock.CreateShippingSendcloud + +[register_mixin] +stock.ShippingSendcloudMixin: trytond.modules.stock_package_shipping.stock.ShippingMixin diff --git a/modules/stock_package_shipping_ups/__init__.py b/modules/stock_package_shipping_ups/__init__.py index 84fed5d31e..4effdfa4a2 100644 --- a/modules/stock_package_shipping_ups/__init__.py +++ b/modules/stock_package_shipping_ups/__init__.py @@ -1,23 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.modules.stock_package_shipping.stock import ShippingMixin -from trytond.pool import Pool - -from . import carrier, stock - - -def register(): - Pool.register( - stock.PackageType, - stock.Package, - carrier.CredentialUPS, - carrier.Carrier, - module='stock_package_shipping_ups', type_='model') - Pool.register( - stock.CreateShipping, - stock.CreateShippingUPS, - module='stock_package_shipping_ups', type_='wizard') - Pool.register_mixin( - stock.ShippingUPSMixin, ShippingMixin, - module='stock_package_shipping_ups') diff --git a/modules/stock_package_shipping_ups/tryton.cfg b/modules/stock_package_shipping_ups/tryton.cfg index 16e35bbd60..14ad982a3a 100644 --- a/modules/stock_package_shipping_ups/tryton.cfg +++ b/modules/stock_package_shipping_ups/tryton.cfg @@ -14,3 +14,16 @@ xml: carrier.xml stock.xml message.xml + +[register] +model: + carrier.CredentialUPS + carrier.Carrier + stock.PackageType + stock.Package +wizard: + stock.CreateShipping + stock.CreateShippingUPS + +[register_mixin] +stock.ShippingUPSMixin: trytond.modules.stock_package_shipping.stock.ShippingMixin diff --git a/modules/stock_product_location/__init__.py b/modules/stock_product_location/__init__.py index 79c40e36d9..4effdfa4a2 100644 --- a/modules/stock_product_location/__init__.py +++ b/modules/stock_product_location/__init__.py @@ -1,21 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import location, product, production - - -def register(): - Pool.register( - product.Template, - product.Product, - location.ProductLocation, - location.Move, - location.ShipmentIn, - location.ShipmentOutReturn, - module='stock_product_location', type_='model') - Pool.register( - production.Production, - module='stock_product_location', type_='model', - depends=['production']) diff --git a/modules/stock_product_location/tryton.cfg b/modules/stock_product_location/tryton.cfg index 64c5f2b29a..3ec085c5aa 100644 --- a/modules/stock_product_location/tryton.cfg +++ b/modules/stock_product_location/tryton.cfg @@ -9,3 +9,16 @@ extras_depend: xml: location.xml product.xml + +[register] +model: + product.Template + product.Product + location.ProductLocation + location.Move + location.ShipmentIn + location.ShipmentOutReturn + +[register production] +model: + production.Production diff --git a/modules/stock_product_location_place/__init__.py b/modules/stock_product_location_place/__init__.py index 5a9513512c..4effdfa4a2 100644 --- a/modules/stock_product_location_place/__init__.py +++ b/modules/stock_product_location_place/__init__.py @@ -1,23 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - stock.ProductLocationPlace, - stock.Move, - stock.ShipmentIn, - stock.ShipmentInReturn, - stock.ShipmentOut, - stock.ShipmentOutReturn, - stock.ShipmentInternal, - stock.InventoryLine, - product.Template, - product.Product, - module='stock_product_location_place', type_='model') diff --git a/modules/stock_product_location_place/tryton.cfg b/modules/stock_product_location_place/tryton.cfg index d5c4d3e892..334a584480 100644 --- a/modules/stock_product_location_place/tryton.cfg +++ b/modules/stock_product_location_place/tryton.cfg @@ -8,3 +8,16 @@ xml: stock.xml product.xml message.xml + +[register] +model: + product.Template + product.Product + stock.ProductLocationPlace + stock.Move + stock.ShipmentIn + stock.ShipmentInReturn + stock.ShipmentOut + stock.ShipmentOutReturn + stock.ShipmentInternal + stock.InventoryLine diff --git a/modules/stock_quantity_early_planning/__init__.py b/modules/stock_quantity_early_planning/__init__.py index 41ff3a89cd..4effdfa4a2 100644 --- a/modules/stock_quantity_early_planning/__init__.py +++ b/modules/stock_quantity_early_planning/__init__.py @@ -1,23 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import stock - -__all__ = ['register'] - - -def register(): - Pool.register( - stock.QuantityEarlyPlan, - stock.Move, - stock.QuantityEarlyPlanGenerateStart, - module='stock_quantity_early_planning', type_='model') - Pool.register( - stock.QuantityEarlyPlanGenerate, - module='stock_quantity_early_planning', type_='wizard') - Pool.register( - stock.QuantityEarlyPlanProduction, - module='stock_quantity_early_planning', type_='model', - depends=['production']) diff --git a/modules/stock_quantity_early_planning/tryton.cfg b/modules/stock_quantity_early_planning/tryton.cfg index be3c3a4df4..614d5f0628 100644 --- a/modules/stock_quantity_early_planning/tryton.cfg +++ b/modules/stock_quantity_early_planning/tryton.cfg @@ -8,3 +8,15 @@ extras_depend: production xml: stock.xml + +[register] +model: + stock.QuantityEarlyPlan + stock.Move + stock.QuantityEarlyPlanGenerateStart +wizard: + stock.QuantityEarlyPlanGenerate + +[register production] +model: + stock.QuantityEarlyPlanProduction diff --git a/modules/stock_quantity_issue/__init__.py b/modules/stock_quantity_issue/__init__.py index 649a2922f6..4effdfa4a2 100644 --- a/modules/stock_quantity_issue/__init__.py +++ b/modules/stock_quantity_issue/__init__.py @@ -1,23 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -__all__ = ['register'] - -from . import ir, stock - - -def register(): - Pool.register( - ir.Cron, - stock.QuantityIssue, - stock.QuantityIssueProduct, - stock.QuantityIssueGenerateStart, - module='stock_quantity_issue', type_='model') - Pool.register( - stock.QuantityIssueGenerate, - module='stock_quantity_issue', type_='wizard') - Pool.register( - stock.QuantityIssueProduction, - module='stock_quantity_issue', type_='model', depends=['production']) diff --git a/modules/stock_quantity_issue/tryton.cfg b/modules/stock_quantity_issue/tryton.cfg index 56f8f38b1d..8e9de22072 100644 --- a/modules/stock_quantity_issue/tryton.cfg +++ b/modules/stock_quantity_issue/tryton.cfg @@ -11,3 +11,16 @@ xml: product.xml stock.xml message.xml + +[register] +model: + ir.Cron + stock.QuantityIssue + stock.QuantityIssueProduct + stock.QuantityIssueGenerateStart +wizard: + stock.QuantityIssueGenerate + +[register production] +model: + stock.QuantityIssueProduction diff --git a/modules/stock_secondary_unit/__init__.py b/modules/stock_secondary_unit/__init__.py index fba76ca0b2..4effdfa4a2 100644 --- a/modules/stock_secondary_unit/__init__.py +++ b/modules/stock_secondary_unit/__init__.py @@ -1,18 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import stock - -__all__ = ['register'] - - -def register(): - Pool.register( - stock.Move, - stock.ShipmentIn, - stock.ShipmentOut, - stock.ShipmentOutReturn, - stock.ShipmentInternal, - module='stock_secondary_unit', type_='model') diff --git a/modules/stock_secondary_unit/tryton.cfg b/modules/stock_secondary_unit/tryton.cfg index 95d84cba0e..ca215e6361 100644 --- a/modules/stock_secondary_unit/tryton.cfg +++ b/modules/stock_secondary_unit/tryton.cfg @@ -6,3 +6,11 @@ depends: product xml: stock.xml + +[register] +model: + stock.Move + stock.ShipmentIn + stock.ShipmentOut + stock.ShipmentOutReturn + stock.ShipmentInternal diff --git a/modules/stock_shipment_cost/__init__.py b/modules/stock_shipment_cost/__init__.py index 5b777855f7..4db896e7ef 100644 --- a/modules/stock_shipment_cost/__init__.py +++ b/modules/stock_shipment_cost/__init__.py @@ -1,27 +1,11 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.modules.stock.stock_reporting_margin import Abstract -from trytond.pool import Pool - -from . import carrier, stock, stock_reporting_margin -from .stock import ShipmentCostMixin - -__all__ = ['register', 'ShipmentCostMixin'] +__all__ = ['ShipmentCostMixin'] -def register(): - Pool.register( - carrier.Carrier, - stock.Move, - stock.ShipmentOut, - stock.ShipmentOutReturn, - stock_reporting_margin.Context, - module='stock_shipment_cost', type_='model') - Pool.register( - module='stock_shipment_cost', type_='wizard') - Pool.register( - module='stock_shipment_cost', type_='report') - Pool.register_mixin( - stock_reporting_margin.AbstractShipmentOutCostMixin, Abstract, - module='stock_shipment_cost') +def __getattr__(name): + if name == 'ShipmentCostMixin': + from .stock import ShipmentCostMixin + return ShipmentCostMixin + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/modules/stock_shipment_cost/tryton.cfg b/modules/stock_shipment_cost/tryton.cfg index f17f44128d..35a3ed0d46 100644 --- a/modules/stock_shipment_cost/tryton.cfg +++ b/modules/stock_shipment_cost/tryton.cfg @@ -9,3 +9,14 @@ xml: carrier.xml stock.xml stock_reporting_margin.xml + +[register] +model: + carrier.Carrier + stock.Move + stock.ShipmentOut + stock.ShipmentOutReturn + stock_reporting_margin.Context + +[register_mixin] +stock_reporting_margin.AbstractShipmentOutCostMixin: trytond.modules.stock.stock_reporting_margin.Abstract diff --git a/modules/stock_shipment_cost_weight/__init__.py b/modules/stock_shipment_cost_weight/__init__.py index d0ce2098ea..4effdfa4a2 100644 --- a/modules/stock_shipment_cost_weight/__init__.py +++ b/modules/stock_shipment_cost_weight/__init__.py @@ -1,16 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import carrier, stock - -__all__ = ['register'] - - -def register(): - Pool.register( - carrier.Carrier, - stock.ShipmentOut, - stock.ShipmentOutReturn, - module='stock_shipment_cost_weight', type_='model') diff --git a/modules/stock_shipment_cost_weight/tryton.cfg b/modules/stock_shipment_cost_weight/tryton.cfg index 906d760d15..a6a94577ff 100644 --- a/modules/stock_shipment_cost_weight/tryton.cfg +++ b/modules/stock_shipment_cost_weight/tryton.cfg @@ -5,3 +5,9 @@ depends: ir stock_shipment_cost stock_shipment_measurements + +[register] +model: + carrier.Carrier + stock.ShipmentOut + stock.ShipmentOutReturn diff --git a/modules/stock_shipment_measurements/__init__.py b/modules/stock_shipment_measurements/__init__.py index e8b456fe24..4effdfa4a2 100644 --- a/modules/stock_shipment_measurements/__init__.py +++ b/modules/stock_shipment_measurements/__init__.py @@ -1,31 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import stock - -__all__ = ['register'] - - -def register(): - Pool.register( - stock.Configuration, - stock.ConfigurationMeasurement, - stock.Move, - stock.ShipmentIn, - stock.ShipmentInReturn, - stock.ShipmentOut, - stock.ShipmentOutReturn, - stock.ShipmentInternal, - module='stock_shipment_measurements', type_='model') - Pool.register( - stock.Package, - stock.ShipmentOutPackage, - stock.ShipmentInReturnPackage, - module='stock_shipment_measurements', type_='model', - depends=['stock_package']) - Pool.register( - module='stock_shipment_measurements', type_='wizard') - Pool.register( - module='stock_shipment_measurements', type_='report') diff --git a/modules/stock_shipment_measurements/tryton.cfg b/modules/stock_shipment_measurements/tryton.cfg index c9c26b4c04..2b7b16236d 100644 --- a/modules/stock_shipment_measurements/tryton.cfg +++ b/modules/stock_shipment_measurements/tryton.cfg @@ -11,3 +11,20 @@ extras_depend: stock_package xml: stock.xml + +[register] +model: + stock.Configuration + stock.ConfigurationMeasurement + stock.Move + stock.ShipmentIn + stock.ShipmentInReturn + stock.ShipmentOut + stock.ShipmentOutReturn + stock.ShipmentInternal + +[register stock_package] +model: + stock.Package + stock.ShipmentOutPackage + stock.ShipmentInReturnPackage diff --git a/modules/stock_split/__init__.py b/modules/stock_split/__init__.py index a41283d46d..4effdfa4a2 100644 --- a/modules/stock_split/__init__.py +++ b/modules/stock_split/__init__.py @@ -1,21 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import stock - - -def register(): - Pool.register( - stock.Move, - stock.SplitMoveStart, - stock.ShipmentInReturn, - stock.ShipmentOut, - stock.ShipmentInternal, - stock.SplitShipmentStart, - module='stock_split', type_='model') - Pool.register( - stock.SplitMove, - stock.SplitShipment, - module='stock_split', type_='wizard') diff --git a/modules/stock_split/tryton.cfg b/modules/stock_split/tryton.cfg index c543f48b76..a3ad32c647 100644 --- a/modules/stock_split/tryton.cfg +++ b/modules/stock_split/tryton.cfg @@ -5,3 +5,15 @@ depends: stock xml: stock.xml + +[register] +model: + stock.Move + stock.SplitMoveStart + stock.ShipmentInReturn + stock.ShipmentOut + stock.ShipmentInternal + stock.SplitShipmentStart +wizard: + stock.SplitMove + stock.SplitShipment diff --git a/modules/stock_supply/__init__.py b/modules/stock_supply/__init__.py index fe0c557161..4effdfa4a2 100644 --- a/modules/stock_supply/__init__.py +++ b/modules/stock_supply/__init__.py @@ -1,26 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import ( - ir, location, order_point, product, purchase_request, shipment, stock) - - -def register(): - Pool.register( - order_point.OrderPoint, - product.Product, - product.ProductSupplier, - purchase_request.PurchaseConfiguration, - purchase_request.PurchaseConfigurationSupplyPeriod, - purchase_request.PurchaseRequest, - shipment.ShipmentInternal, - location.Location, - location.LocationLeadTime, - stock.SupplyStart, - ir.Cron, - module='stock_supply', type_='model') - Pool.register( - stock.Supply, - module='stock_supply', type_='wizard') diff --git a/modules/stock_supply/tryton.cfg b/modules/stock_supply/tryton.cfg index 69f28772b7..907fb671fd 100644 --- a/modules/stock_supply/tryton.cfg +++ b/modules/stock_supply/tryton.cfg @@ -16,3 +16,19 @@ xml: location.xml stock.xml message.xml + +[register] +model: + ir.Cron + product.Product + product.ProductSupplier + order_point.OrderPoint + location.Location + location.LocationLeadTime + shipment.ShipmentInternal + stock.SupplyStart + purchase_request.PurchaseConfiguration + purchase_request.PurchaseConfigurationSupplyPeriod + purchase_request.PurchaseRequest +wizard: + stock.Supply diff --git a/modules/stock_supply_day/__init__.py b/modules/stock_supply_day/__init__.py index ce1eed4c23..4effdfa4a2 100644 --- a/modules/stock_supply_day/__init__.py +++ b/modules/stock_supply_day/__init__.py @@ -1,13 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import purchase - - -def register(): - Pool.register( - purchase.ProductSupplier, - purchase.ProductSupplierDay, - module='stock_supply_day', type_='model') diff --git a/modules/stock_supply_day/tryton.cfg b/modules/stock_supply_day/tryton.cfg index 18069587f9..80822ca7f1 100644 --- a/modules/stock_supply_day/tryton.cfg +++ b/modules/stock_supply_day/tryton.cfg @@ -5,3 +5,8 @@ depends: purchase xml: purchase.xml + +[register] +model: + purchase.ProductSupplier + purchase.ProductSupplierDay diff --git a/modules/stock_supply_forecast/__init__.py b/modules/stock_supply_forecast/__init__.py index 78dd684cf9..4effdfa4a2 100644 --- a/modules/stock_supply_forecast/__init__.py +++ b/modules/stock_supply_forecast/__init__.py @@ -1,12 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import stock - - -def register(): - Pool.register( - stock.Supply, - module='stock_supply_forecast', type_='wizard') diff --git a/modules/stock_supply_forecast/tryton.cfg b/modules/stock_supply_forecast/tryton.cfg index dfd9692e93..0dac0ea5f1 100644 --- a/modules/stock_supply_forecast/tryton.cfg +++ b/modules/stock_supply_forecast/tryton.cfg @@ -4,3 +4,7 @@ depends: ir stock_supply stock_forecast + +[register] +wizard: + stock.Supply diff --git a/modules/stock_supply_production/__init__.py b/modules/stock_supply_production/__init__.py index e5df0d9cf1..4effdfa4a2 100644 --- a/modules/stock_supply_production/__init__.py +++ b/modules/stock_supply_production/__init__.py @@ -1,20 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import product, production, stock - - -def register(): - Pool.register( - stock.OrderPoint, - stock.LocationLeadTime, - production.Configuration, - production.ConfigurationSupplyPeriod, - production.Production, - product.Product, - module='stock_supply_production', type_='model') - Pool.register( - stock.StockSupply, - module='stock_supply_production', type_='wizard') diff --git a/modules/stock_supply_production/tryton.cfg b/modules/stock_supply_production/tryton.cfg index 56cbe4b8e5..d2a5d89cd5 100644 --- a/modules/stock_supply_production/tryton.cfg +++ b/modules/stock_supply_production/tryton.cfg @@ -10,3 +10,14 @@ xml: production.xml stock.xml message.xml + +[register] +model: + product.Product + stock.OrderPoint + stock.LocationLeadTime + production.Configuration + production.ConfigurationSupplyPeriod + production.Production +wizard: + stock.StockSupply diff --git a/modules/timesheet/__init__.py b/modules/timesheet/__init__.py index 5e4392ef75..aed6e0e6c7 100644 --- a/modules/timesheet/__init__.py +++ b/modules/timesheet/__init__.py @@ -1,25 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool -from . import ir, line, routes, user, work +from . import routes -__all__ = ['register', 'routes'] - - -def register(): - Pool.register( - ir.Rule, - work.Work, - work.WorkContext, - line.Line, - line.EnterLinesStart, - line.HoursEmployee, - line.HoursEmployeeContext, - line.HoursEmployeeWeekly, - line.HoursEmployeeMonthly, - user.UserApplication, - module='timesheet', type_='model') - Pool.register( - line.EnterLines, - module='timesheet', type_='wizard') +__all__ = [routes] diff --git a/modules/timesheet/tryton.cfg b/modules/timesheet/tryton.cfg index 2eb7b4267b..b41dfd298d 100644 --- a/modules/timesheet/tryton.cfg +++ b/modules/timesheet/tryton.cfg @@ -10,3 +10,18 @@ xml: work.xml line.xml message.xml + +[register] +model: + ir.Rule + user.UserApplication + work.Work + work.WorkContext + line.Line + line.EnterLinesStart + line.HoursEmployee + line.HoursEmployeeContext + line.HoursEmployeeWeekly + line.HoursEmployeeMonthly +wizard: + line.EnterLines diff --git a/modules/timesheet_cost/__init__.py b/modules/timesheet_cost/__init__.py index 2a96cb3f43..4effdfa4a2 100644 --- a/modules/timesheet_cost/__init__.py +++ b/modules/timesheet_cost/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import company, timesheet - - -def register(): - Pool.register( - company.Employee, - company.EmployeeCostPrice, - timesheet.Line, - module='timesheet_cost', type_='model') diff --git a/modules/timesheet_cost/tryton.cfg b/modules/timesheet_cost/tryton.cfg index 8e3ba8b7e5..4b13648ed0 100644 --- a/modules/timesheet_cost/tryton.cfg +++ b/modules/timesheet_cost/tryton.cfg @@ -9,3 +9,9 @@ xml: company.xml timesheet.xml message.xml + +[register] +model: + company.Employee + company.EmployeeCostPrice + timesheet.Line diff --git a/modules/user_role/__init__.py b/modules/user_role/__init__.py index 742290f2a1..4effdfa4a2 100644 --- a/modules/user_role/__init__.py +++ b/modules/user_role/__init__.py @@ -1,22 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import ir, res - -__all__ = ['register'] - - -def register(): - Pool.register( - res.Role, - res.RoleGroup, - res.User, - res.UserRole, - ir.Cron, - module='user_role', type_='model') - Pool.register( - module='user_role', type_='wizard') - Pool.register( - module='user_role', type_='report') diff --git a/modules/user_role/tryton.cfg b/modules/user_role/tryton.cfg index 951ca8e2f0..2a3d6e24a4 100644 --- a/modules/user_role/tryton.cfg +++ b/modules/user_role/tryton.cfg @@ -5,3 +5,11 @@ depends: res xml: res.xml + +[register] +model: + ir.Cron + res.Role + res.RoleGroup + res.User + res.UserRole diff --git a/modules/web_shop/__init__.py b/modules/web_shop/__init__.py index e9e390d36c..4effdfa4a2 100644 --- a/modules/web_shop/__init__.py +++ b/modules/web_shop/__init__.py @@ -1,37 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -__all__ = ['register'] - -from . import product, sale, web - - -def register(): - Pool.register( - web.Shop, - web.Shop_Warehouse, - web.Shop_Country, - web.Shop_Product, - web.Shop_ProductCategory, - web.User, - product.Template, - product.Product, - product.Category, - sale.Sale, - module='web_shop', type_='model') - Pool.register( - web.ShopAttribute, - web.Shop_Attribute, - product.Attribute, - module='web_shop', type_='model', depends=['product_attribute']) - Pool.register( - product.Image, - module='web_shop', type_='model', depends=['product_image']) - Pool.register( - web.Shop_PriceList, - module='web_shop', type_='model', depends=['sale_price_list']) - Pool.register( - web.Shop_TaxRuleCountry, - module='web_shop', type_='model', depends=['account_tax_rule_country']) diff --git a/modules/web_shop/tryton.cfg b/modules/web_shop/tryton.cfg index 201ee71939..febebade49 100644 --- a/modules/web_shop/tryton.cfg +++ b/modules/web_shop/tryton.cfg @@ -20,3 +20,34 @@ xml: product.xml sale.xml message.xml + +[register] +model: + web.Shop + web.Shop_Warehouse + web.Shop_Country + web.Shop_Product + web.Shop_ProductCategory + web.User + product.Template + product.Product + product.Category + sale.Sale + +[register account_tax_rule_country] +model: + web.Shop_TaxRuleCountry + +[register product_attribute] +model: + web.ShopAttribute + web.Shop_Attribute + product.Attribute + +[register product_image] +model: + product.Image + +[register sale_price_list] +model: + web.Shop_PriceList diff --git a/modules/web_shop_product_data_feed/__init__.py b/modules/web_shop_product_data_feed/__init__.py index 4ec9c03aaf..aed6e0e6c7 100644 --- a/modules/web_shop_product_data_feed/__init__.py +++ b/modules/web_shop_product_data_feed/__init__.py @@ -1,36 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool +from . import routes -from . import ir, product, routes, web - -__all__ = ['register', 'routes'] - - -def register(): - Pool.register( - ir.Cron, - product.UoM, - product.Template, - product.Product, - product.CategoryGoogle, - product.CategoryFacebook, - web.Shop, - module='web_shop_product_data_feed', type_='model') - Pool.register( - web.Shop_Kit, - module='web_shop_product_data_feed', type_='model', - depends=['product_kit']) - Pool.register( - web.Shop_Measurement, - module='web_shop_product_data_feed', type_='model', - depends=['product_measurements']) - Pool.register( - web.Shop_ShipmentCost, - module='web_shop_product_data_feed', type_='model', - depends=['sale_shipment_cost']) - Pool.register( - web.Shop_TaxRuleCountry, - module='web_shop_product_data_feed', type_='model', - depends=['account_tax_rule_country']) +__all__ = [routes] diff --git a/modules/web_shop_product_data_feed/tryton.cfg b/modules/web_shop_product_data_feed/tryton.cfg index 5b046b606f..5a50aa2a72 100644 --- a/modules/web_shop_product_data_feed/tryton.cfg +++ b/modules/web_shop_product_data_feed/tryton.cfg @@ -12,3 +12,29 @@ extras_depend: xml: product.xml web.xml + +[register] +model: + ir.Cron + product.UoM + product.Template + product.Product + product.CategoryGoogle + product.CategoryFacebook + web.Shop + +[register account_tax_rule_country] +model: + web.Shop_TaxRuleCountry + +[register product_measurements] +model: + web.Shop_Measurement + +[register product_kit] +model: + web.Shop_Kit + +[register sale_shipment_cost] +model: + web.Shop_ShipmentCost diff --git a/modules/web_shop_shopify/__init__.py b/modules/web_shop_shopify/__init__.py index 374f19ad1b..51b4b761ce 100644 --- a/modules/web_shop_shopify/__init__.py +++ b/modules/web_shop_shopify/__init__.py @@ -1,71 +1,8 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool +from . import routes, shopify_retry -from . import ( - account, ir, party, product, routes, sale, shopify_retry, stock, web) - -__all__ = ['register', 'routes'] +__all__ = [routes] shopify_retry.patch() - - -def register(): - Pool.register( - ir.Cron, - web.Shop, - web.ShopShopifyIdentifier, - web.Shop_Warehouse, - web.Shop_Attribute, - web.ShopShopifyPaymentJournal, - product.Category, - product.TemplateCategory, - product.Template, - product.Product, - product.ShopifyInventoryItem, - product.ProductIdentifier, - product.AttributeSet, - product.Attribute, - party.Party, - party.Address, - sale.Sale, - sale.Line, - account.Payment, - account.PaymentJournal, - stock.ShipmentOut, - stock.ShipmentShopifyIdentifier, - stock.Move, - module='web_shop_shopify', type_='model') - Pool.register( - product.ShopifyInventoryItem_Customs, - product.Product_TariffCode, - module='web_shop_shopify', type_='model', depends=['customs']) - Pool.register( - product.Image, - module='web_shop_shopify', type_='model', depends=['product_image']) - Pool.register( - product.Image_Attribute, - module='web_shop_shopify', type_='model', - depends=['product_attribute', 'product_image_attribute']) - Pool.register( - sale.Line_Discount, - module='web_shop_shopify', type_='model', depends=['sale_discount']) - Pool.register( - product.Template_SaleSecondaryUnit, - product.Product_SaleSecondaryUnit, - sale.Line_SaleSecondaryUnit, - module='web_shop_shopify', type_='model', - depends=['sale_secondary_unit']) - Pool.register( - sale.Sale_ShipmentCost, - sale.Line_ShipmentCost, - module='web_shop_shopify', type_='model', - depends=['sale_shipment_cost']) - Pool.register( - stock.ShipmentOut_PackageShipping, - module='web_shop_shopify', type_='model', - depends=['stock_package_shipping']) - Pool.register( - party.Replace, - module='web_shop_shopify', type_='wizard') diff --git a/modules/web_shop_shopify/tryton.cfg b/modules/web_shop_shopify/tryton.cfg index ebe6351ba7..5b6e0583b4 100644 --- a/modules/web_shop_shopify/tryton.cfg +++ b/modules/web_shop_shopify/tryton.cfg @@ -28,3 +28,63 @@ xml: web.xml stock.xml message.xml + +[register] +model: + ir.Cron + web.Shop + web.ShopShopifyIdentifier + web.Shop_Warehouse + web.Shop_Attribute + web.ShopShopifyPaymentJournal + product.Category + product.TemplateCategory + product.Template + product.Product + product.ShopifyInventoryItem + product.ProductIdentifier + product.AttributeSet + product.Attribute + party.Party + party.Address + sale.Sale + sale.Line + account.Payment + account.PaymentJournal + stock.ShipmentOut + stock.ShipmentShopifyIdentifier + stock.Move +wizard: + party.Replace + +[register customs] +model: + product.ShopifyInventoryItem_Customs + product.Product_TariffCode + +[register product_image] +model: + product.Image + +[register product_image_attribute] +model: + product.Image_Attribute + +[register sale_discount] +model: + sale.Line_Discount + +[register sale_secondary_unit] +model: + product.Template_SaleSecondaryUnit + product.Product_SaleSecondaryUnit + sale.Line_SaleSecondaryUnit + +[register sale_shipment_cost] +model: + sale.Sale_ShipmentCost + sale.Line_ShipmentCost + +[register stock_package_shipping] +model: + stock.ShipmentOut_PackageShipping diff --git a/modules/web_shop_vue_storefront/__init__.py b/modules/web_shop_vue_storefront/__init__.py index eb71449c26..aed6e0e6c7 100644 --- a/modules/web_shop_vue_storefront/__init__.py +++ b/modules/web_shop_vue_storefront/__init__.py @@ -1,46 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool - from . import routes -__all__ = ['register', 'routes'] - -from . import carrier, ir, party, product, sale, web - - -def register(): - Pool.register( - web.Shop, - web.ShopVSFIdentifier, - web.User, - ir.Cron, - party.Address, - party.Identifier, - product.Product, - product.Template, - product.Category, - sale.Sale, - sale.Line, - module='web_shop_vue_storefront', type_='model') - Pool.register( - product.ProductAttribute, - product.TemplateAttribute, - product.Attribute, - sale.LineAttribute, - module='web_shop_vue_storefront', type_='model', - depends=['product_attribute']) - Pool.register( - web.ShopCoupon, - module='web_shop_vue_storefront', type_='model', - depends=['sale_promotion_coupon']) - Pool.register( - carrier.Carrier, - module='web_shop_vue_storefront', type_='model', - depends=['carrier']) - Pool.register( - web.ShopShipmentCost, - sale.SaleShipmentCost, - module='web_shop_vue_storefront', type_='model', - depends=['sale_shipment_cost']) +__all__ = [routes] diff --git a/modules/web_shop_vue_storefront/tryton.cfg b/modules/web_shop_vue_storefront/tryton.cfg index 7d1d7f52ce..0544a840d4 100644 --- a/modules/web_shop_vue_storefront/tryton.cfg +++ b/modules/web_shop_vue_storefront/tryton.cfg @@ -16,3 +16,37 @@ extras_depend: xml: web.xml message.xml + +[register] +model: + ir.Cron + web.Shop + web.ShopVSFIdentifier + web.User + party.Address + party.Identifier + product.Product + product.Template + product.Category + sale.Sale + sale.Line + +[register carrier] +model: + carrier.Carrier + +[register product_attribute] +model: + product.ProductAttribute + product.TemplateAttribute + product.Attribute + sale.LineAttribute + +[register sale_promotion_coupon] +model: + web.ShopCoupon + +[register sale_shipment_cost] +model: + web.ShopShipmentCost + sale.SaleShipmentCost diff --git a/modules/web_shop_vue_storefront_stripe/__init__.py b/modules/web_shop_vue_storefront_stripe/__init__.py index b7afa767a2..4effdfa4a2 100644 --- a/modules/web_shop_vue_storefront_stripe/__init__.py +++ b/modules/web_shop_vue_storefront_stripe/__init__.py @@ -1,14 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -__all__ = ['register'] - -from . import web - - -def register(): - Pool.register( - web.Shop, - module='web_shop_vue_storefront_stripe', type_='model') diff --git a/modules/web_shop_vue_storefront_stripe/tryton.cfg b/modules/web_shop_vue_storefront_stripe/tryton.cfg index 42cbf82d48..2e6839e79d 100644 --- a/modules/web_shop_vue_storefront_stripe/tryton.cfg +++ b/modules/web_shop_vue_storefront_stripe/tryton.cfg @@ -8,3 +8,7 @@ depends: web_shop_vue_storefront xml: web.xml + +[register] +model: + web.Shop diff --git a/modules/web_shortener/__init__.py b/modules/web_shortener/__init__.py index b3f2573b78..aed6e0e6c7 100644 --- a/modules/web_shortener/__init__.py +++ b/modules/web_shortener/__init__.py @@ -1,19 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool +from . import routes -from . import routes, web - -__all__ = ['register', 'routes'] - - -def register(): - Pool.register( - web.ShortenedURL, - web.URLAccess, - module='web_shortener', type_='model') - Pool.register( - module='web_shortener', type_='wizard') - Pool.register( - module='web_shortener', type_='report') +__all__ = [routes] diff --git a/modules/web_shortener/tryton.cfg b/modules/web_shortener/tryton.cfg index b36349e652..281aa019b5 100644 --- a/modules/web_shortener/tryton.cfg +++ b/modules/web_shortener/tryton.cfg @@ -4,3 +4,8 @@ depends: ir xml: web.xml + +[register] +model: + web.ShortenedURL + web.URLAccess diff --git a/modules/web_user/__init__.py b/modules/web_user/__init__.py index 3d065429f8..4effdfa4a2 100644 --- a/modules/web_user/__init__.py +++ b/modules/web_user/__init__.py @@ -1,25 +1,2 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. - -from trytond.pool import Pool - -from . import ir, party, user - - -def register(): - Pool.register( - user.User, - user.User_PartySecondary, - user.UserAuthenticateAttempt, - user.UserSession, - ir.Email, - ir.EmailTemplate, - module='web_user', type_='model') - Pool.register( - party.Replace, - party.Erase, - module='web_user', type_='wizard') - Pool.register( - user.EmailValidation, - user.EmailResetPassword, - module='web_user', type_='report') diff --git a/modules/web_user/tryton.cfg b/modules/web_user/tryton.cfg index 54ca58a46b..242494270e 100644 --- a/modules/web_user/tryton.cfg +++ b/modules/web_user/tryton.cfg @@ -6,3 +6,18 @@ depends: xml: user.xml message.xml + +[register] +model: + ir.Email + ir.EmailTemplate + user.User + user.User_PartySecondary + user.UserAuthenticateAttempt + user.UserSession +wizard: + party.Replace + party.Erase +report: + user.EmailValidation + user.EmailResetPassword diff --git a/trytond/CHANGELOG b/trytond/CHANGELOG index 61d96e8376..730ccfe3f8 100644 --- a/trytond/CHANGELOG +++ b/trytond/CHANGELOG @@ -1,3 +1,4 @@ +* Use ``tryton.cfg`` to register in the Pool * Use the FILTER syntax with SQL aggregate functions * Use the EXISTS operator when using the 'where' operator in Many2One * Redact sensitive values from the log (issue14220) diff --git a/trytond/doc/ref/pool.rst b/trytond/doc/ref/pool.rst index 19273478dc..79ecf74dc7 100644 --- a/trytond/doc/ref/pool.rst +++ b/trytond/doc/ref/pool.rst @@ -69,7 +69,6 @@ Instance methods: Include all the mixin registered for the filled modules to the corresponding registered type of classes or named. - PoolMeta -------- diff --git a/trytond/doc/topics/modules/index.rst b/trytond/doc/topics/modules/index.rst index 6eb644f62d..7da570cb57 100644 --- a/trytond/doc/topics/modules/index.rst +++ b/trytond/doc/topics/modules/index.rst @@ -26,8 +26,6 @@ files: ------------------------ It is the Python :file:`__init__.py` to define a module. -It must contain a method named ``register()`` that must register all the -objects of the module in the :class:`~trytond.pool.Pool`. .. _topics-modules-tryton-cfg: @@ -56,21 +54,42 @@ contain a ``[tryton]`` section with the following keys: They will be loaded in the given order when the module is activated or updated. +It may contain some ``[register]`` or ``[register ]`` sections +with the keys ``model``, ``wizard`` and ``report`` defining the ``type_`` and +qualified name of class relative to the module as a one per line list to pass +to :meth:`~trytond.pool.Pool.register`. + +.. note:: + The ```` in the section name set the ``depends``. + +And it also may contain a ``[register_mixin]`` which define the pair of +qualified name relative to the module of mixin and subsclass to pass to +:meth:`~trytond.pool.Pool.register_mixin`. + Here is an example: .. code-block:: ini - [tryton] - version=0.0.1 - depends: - ir - res - country - xml: - party.xml - category.xml - address.xml - contact_mechanism.xml + [tryton] + version=0.0.1 + depends: + country + ir + res + xml: + party.xml + category.xml + address.xml + contact_mechanism.xml + + [register] + model: + category.Category + party.Party + address.Address + contact_mechanism.ContactMechanism + wizard: + party.Replace Python Files ============ diff --git a/trytond/doc/tutorial/module/extend.rst b/trytond/doc/tutorial/module/extend.rst index 076c7727c9..3d639ca998 100644 --- a/trytond/doc/tutorial/module/extend.rst +++ b/trytond/doc/tutorial/module/extend.rst @@ -26,17 +26,16 @@ The model in :file:`party.py` file of our module looks like this: 'training.opportunity', 'party', "Opportunities") This new class must be register in the :class:`~trytond.pool.Pool`. -So in :file:`__init__.py` we add: +So in :file:`tryton.cfg` we add: -.. code-block:: python +.. code-block:: ini - from . import party - - def register(): - Pool.register( - ..., - party.Party, - module='opportunity', type_='model') + [tryton] + ... + [register] + model: + ... + party.Party Change a field of the Party model ````````````````````````````````` diff --git a/trytond/doc/tutorial/module/model.rst b/trytond/doc/tutorial/module/model.rst index 9cdce653d7..260e61da92 100644 --- a/trytond/doc/tutorial/module/model.rst +++ b/trytond/doc/tutorial/module/model.rst @@ -49,23 +49,22 @@ This model is defined by the ``party`` module. Register the model in the Pool ------------------------------ -Once a Tryton model is defined, you need to register it in the +Once a Tryton model is defined, you need to declare to register it in the :class:`~trytond.pool.Pool`. -This is done in the :file:`__init__.py` file of your module with the following +This is done in the :file:`tryton.cfg` file of your module with the following code: -.. code-block:: python +.. code-block:: ini - from trytond.pool import Pool - from . import opportunity + [tryton] + ... + [register] + model: + opportunity.Opportunity - def register(): - Pool.register( - opportunity.Opportunity, - module='opportunity', type_='model') - -Models in the pool are inspected by Tryton when activating or updating a module -in order to create or update the schema of the table in the database. +Models registered in the pool are inspected by Tryton when activating or +updating a module in order to create or update the schema of the table in the +database. Activate the opportunity module ------------------------------- @@ -73,8 +72,8 @@ Activate the opportunity module Now that we have a basic module, we will use it to create the related table into the :ref:`database created `. -First we must edit the :file:`tryton.cfg` file to specify that this module -depends on the ``party`` and ``ir`` module. +First we must edit again the :file:`tryton.cfg` file to specify that this +module depends on the ``party`` and ``ir`` module. We need to do this because the ``Opportunity`` model contains the ``party`` field which refers to the ``Party`` model. And we always need the ``ir`` module which is always included in Tryton server. @@ -88,6 +87,9 @@ Here is the content of our :file:`tryton.cfg` file: depends: ir party + [register] + model: + opportunity.Opportunity As we defined a new dependency, we must refresh the installation with: diff --git a/trytond/doc/tutorial/module/report.rst b/trytond/doc/tutorial/module/report.rst index ad601d1987..9ae3e9cd46 100644 --- a/trytond/doc/tutorial/module/report.rst +++ b/trytond/doc/tutorial/module/report.rst @@ -17,15 +17,16 @@ First we create a ``trytond.report.Report`` class in :file:`opportunity.py`: __name__ = 'training.opportunity.report' And we register it in the :class:`~trytond.pool.Pool` as type ``report`` in -:file:`__init__.py`: +:file:`tryton.cfg`: -.. code-block:: python +.. code-block:: ini - def register(): - ... - Pool.register( - opportunity.OpportunityReport, - module='opportunity', type_='report') + [tryton] + ... + [register] + ... + wizard: + opportunity.OpportunityReport Now we have to create a `Report ` and `Action Keyword diff --git a/trytond/doc/tutorial/module/table_query.rst b/trytond/doc/tutorial/module/table_query.rst index 563a691bf1..577596ef15 100644 --- a/trytond/doc/tutorial/module/table_query.rst +++ b/trytond/doc/tutorial/module/table_query.rst @@ -62,16 +62,16 @@ First we create a :class:`~trytond.model.ModelSQL` class which defines a returned by ``date_trunc`` into a :py:class:`~datetime.date`. Then as usual we register the :class:`~trytond.model.ModelSQL` class in the in -the :class:`~trytond.pool.Pool` as type ``model`` in :file:`__init__.py`: +the :class:`~trytond.pool.Pool` as type ``model`` in :file:`tryton.cfg`: -.. code-block:: python +.. code-block:: ini - def register(): - ... - Pool.register( - ..., - opportunity.OpportunityMonthly, - module='opportunity', type_='model') + [tryton] + ... + [register] + model: + ... + opportunity.OpportunityMonthly And to display we create a list view and the menu entry in :file:`opportunity.xml`: diff --git a/trytond/doc/tutorial/module/wizard.rst b/trytond/doc/tutorial/module/wizard.rst index ffeef005ae..74b8d095df 100644 --- a/trytond/doc/tutorial/module/wizard.rst +++ b/trytond/doc/tutorial/module/wizard.rst @@ -98,15 +98,16 @@ Now we can define the :class:`~trytond.wizard.Wizard` with a ``start`` We added an optional ``end_date`` to the convert method. And we register it in the :class:`~trytond.pool.Pool` as type ``wizard`` in -:file:`__init__.py`: +:file:`tryton.cfg`: -.. code-block:: python +.. code-block:: ini - def register(): - ... - Pool.register( - opportunity.Convert, - module='opportunity', type_='wizard') + [tryton] + ... + [register] + ... + wizard: + opportunity.Convert Finally we just need to create a `Wizard ` and an `Action Keyword ` in :file:`opportunity.xml`: diff --git a/trytond/trytond/i18n.py b/trytond/trytond/i18n.py index 3d6b1b9640..b06848c7c9 100644 --- a/trytond/trytond/i18n.py +++ b/trytond/trytond/i18n.py @@ -11,10 +11,9 @@ def _ngettext(message_id, *args, **variables): if not Transaction().database: return message_id pool = Pool() - try: - Message = pool.get('ir.message') - except KeyError: + if not pool.ready: return message_id + Message = pool.get('ir.message') if len(args) < 2: n, = args language = Transaction().language diff --git a/trytond/trytond/ir/__init__.py b/trytond/trytond/ir/__init__.py index 179ef11154..aed6e0e6c7 100644 --- a/trytond/trytond/ir/__init__.py +++ b/trytond/trytond/ir/__init__.py @@ -1,119 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool -from . import ( - action, attachment, avatar, cache, calendar_, chat, configuration, cron, - date, email_, error, export, lang, message, model, module, note, queue_, - routes, rule, sequence, session, translation, trigger, ui) +from . import routes -__all__ = ['register', 'routes'] - - -def register(): - Pool.register( - model.ModelField, # register first for model char migration - configuration.Configuration, - translation.Translation, - translation.TranslationSetStart, - translation.TranslationSetSucceed, - translation.TranslationCleanStart, - translation.TranslationCleanSucceed, - translation.TranslationUpdateStart, - translation.TranslationExportStart, - translation.TranslationExportResult, - sequence.SequenceType, - sequence.SequenceTypeGroup, - sequence.Sequence, - sequence.SequenceStrict, - ui.menu.UIMenu, - ui.menu.UIMenuGroup, - ui.menu.UIMenuFavorite, - ui.view.View, - ui.view.ShowViewStart, - ui.view.ViewTreeWidth, - ui.view.ViewTreeOptional, - ui.view.ViewTreeState, - ui.view.ViewSearch, - ui.icon.Icon, - action.Action, - action.ActionGroup, - action.ActionKeyword, - action.ActionReport, - action.ActionActWindow, - action.ActionActWindowView, - action.ActionActWindowDomain, - action.ActionWizard, - action.ActionURL, - model.Model, - model.ModelAccess, - model.ModelFieldAccess, - model.ModelButton, - model.ModelButtonGroup, - model.ModelButtonRule, - model.ModelButtonClick, - model.ModelButtonReset, - model.ModelData, - model.Log, - model.PrintModelGraphStart, - attachment.Attachment, - note.Note, - note.NoteRead, - avatar.Avatar, - avatar.AvatarCache, - cron.Cron, - cron.Log, - lang.Lang, - lang.LangConfigStart, - export.Export, - export.ExportLine, - export.ExportGroup, - export.ExportWriteGroup, - rule.RuleGroup, - rule.RuleGroup_Group, - rule.Rule, - module.Module, - module.ModuleDependency, - module.ModuleConfigWizardItem, - module.ModuleConfigWizardFirst, - module.ModuleConfigWizardOther, - module.ModuleConfigWizardDone, - module.ModuleActivateUpgradeStart, - module.ModuleActivateUpgradeDone, - module.ModuleConfigStart, - cache.Cache, - date.Date, - trigger.Trigger, - trigger.TriggerLog, - session.Session, - session.SessionWizard, - queue_.Queue, - calendar_.Month, - calendar_.Day, - message.Message, - email_.Email, - email_.EmailAddress, - email_.EmailTemplate, - email_.EmailTemplate_Report, - error.Error, - chat.Channel, - chat.Follower, - chat.Message, - module='ir', type_='model') - Pool.register( - translation.TranslationSet, - translation.TranslationClean, - translation.TranslationUpdate, - translation.TranslationExport, - translation.TranslationReport, - ui.view.ShowView, - model.PrintModelGraph, - module.ModuleConfigWizard, - module.ModuleActivateUpgrade, - module.ModuleConfig, - lang.LangConfig, - module='ir', type_='wizard') - Pool.register( - model.ModelGraph, - model.ModelWorkflowGraph, - module='ir', type_='report') +__all__ = [routes] diff --git a/trytond/trytond/ir/tryton.cfg b/trytond/trytond/ir/tryton.cfg index 9db68b4c9a..93bc14840e 100644 --- a/trytond/trytond/ir/tryton.cfg +++ b/trytond/trytond/ir/tryton.cfg @@ -22,3 +22,109 @@ xml: queue.xml email.xml error.xml + +[register] +model: + # register first for model char migration + model.ModelField + configuration.Configuration + translation.Translation + translation.TranslationSetStart + translation.TranslationSetSucceed + translation.TranslationCleanStart + translation.TranslationCleanSucceed + translation.TranslationUpdateStart + translation.TranslationExportStart + translation.TranslationExportResult + sequence.SequenceType + sequence.SequenceTypeGroup + sequence.Sequence + sequence.SequenceStrict + ui.menu.UIMenu + ui.menu.UIMenuGroup + ui.menu.UIMenuFavorite + ui.view.View + ui.view.ShowViewStart + ui.view.ViewTreeWidth + ui.view.ViewTreeOptional + ui.view.ViewTreeState + ui.view.ViewSearch + ui.icon.Icon + action.Action + action.ActionGroup + action.ActionKeyword + action.ActionReport + action.ActionActWindow + action.ActionActWindowView + action.ActionActWindowDomain + action.ActionWizard + action.ActionURL + model.Model + model.ModelAccess + model.ModelFieldAccess + model.ModelButton + model.ModelButtonGroup + model.ModelButtonRule + model.ModelButtonClick + model.ModelButtonReset + model.ModelData + model.Log + model.PrintModelGraphStart + attachment.Attachment + note.Note + note.NoteRead + avatar.Avatar + avatar.AvatarCache + cron.Cron + cron.Log + lang.Lang + lang.LangConfigStart + export.Export + export.ExportLine + export.ExportGroup + export.ExportWriteGroup + rule.RuleGroup + rule.RuleGroup_Group + rule.Rule + module.Module + module.ModuleDependency + module.ModuleConfigWizardItem + module.ModuleConfigWizardFirst + module.ModuleConfigWizardOther + module.ModuleConfigWizardDone + module.ModuleActivateUpgradeStart + module.ModuleActivateUpgradeDone + module.ModuleConfigStart + cache.Cache + date.Date + trigger.Trigger + trigger.TriggerLog + session.Session + session.SessionWizard + queue_.Queue + calendar_.Month + calendar_.Day + message.Message + email_.Email + email_.EmailAddress + email_.EmailTemplate + email_.EmailTemplate_Report + error.Error + chat.Channel + chat.Follower + chat.Message +wizard: + translation.TranslationSet + translation.TranslationClean + translation.TranslationUpdate + translation.TranslationExport + translation.TranslationReport + ui.view.ShowView + model.PrintModelGraph + module.ModuleConfigWizard + module.ModuleActivateUpgrade + module.ModuleConfig + lang.LangConfig +report: + model.ModelGraph + model.ModelWorkflowGraph diff --git a/trytond/trytond/modules/__init__.py b/trytond/trytond/modules/__init__.py index 70ec223d95..bcddc911f3 100644 --- a/trytond/trytond/modules/__init__.py +++ b/trytond/trytond/modules/__init__.py @@ -5,6 +5,7 @@ import itertools import logging import os import pkgutil +import warnings from collections import defaultdict from glob import iglob @@ -30,12 +31,19 @@ MODULES_PATH = os.path.abspath(os.path.dirname(__file__)) MODULES = [] +def parse_module_config(name): + "Return a ConfigParser instance and directory of the module" + config = configparser.ConfigParser() + config.optionxform = lambda option: option + with tools.file_open(os.path.join(name, 'tryton.cfg')) as fp: + config.read_file(fp) + directory = os.path.dirname(fp.name) + return config, directory + + def get_module_info(name): "Return the content of the tryton.cfg" - module_config = configparser.ConfigParser() - with tools.file_open(os.path.join(name, 'tryton.cfg')) as fp: - module_config.read_file(fp) - directory = os.path.dirname(fp.name) + module_config, directory = parse_module_config(name) info = dict(module_config.items('tryton')) info['directory'] = directory for key in ('depends', 'extras_depend', 'xml'): @@ -44,6 +52,34 @@ def get_module_info(name): return info +def get_module_register(name): + "Return classes to register from tryton.cfg" + module_config, _ = parse_module_config(name) + for section in module_config.sections(): + if section == 'register' or section.startswith('register '): + depends = section[len('register'):].strip().split() + for type_ in ['model', 'report', 'wizard']: + if not module_config.has_option(section, type_): + continue + classes = module_config.get( + section, type_).strip().splitlines() + yield classes, { + 'module': name, + 'type_': type_, + 'depends': depends, + } + + +def get_module_register_mixin(name): + "Return classes to register_mixin from tryton.cfg" + module_config, _ = parse_module_config(name) + if module_config.has_section('register_mixin'): + for mixin, classinfo in module_config.items('register_mixin'): + yield [mixin, classinfo], { + 'module': name, + } + + class Graph(dict): def get(self, name): if name in self: @@ -335,24 +371,38 @@ def register_classes(with_test=False): Import modules to register the classes in the Pool ''' import trytond.ir - trytond.ir.register() import trytond.res - trytond.res.register() + from trytond.pool import Pool + + base_modules = ['ir', 'res'] + for module_name in base_modules: + logger.info("%s register", module_name) + for args, kwargs in get_module_register(module_name): + Pool.register(*args, **kwargs) + for args, kwargs in get_module_register_mixin(module_name): + Pool.register_mixin(*args, **kwargs) if with_test: + base_modules.append('tests') import trytond.tests + logger.info("tests register") trytond.tests.register() for node in create_graph(get_modules(with_test=with_test)): module_name = node.name - logger.info('%s import', module_name) - - if module_name in ('ir', 'res', 'tests'): + if module_name in base_modules: MODULES.append(module_name) continue - + logger.info("%s register", module_name) + for args, kwargs in get_module_register(module_name): + Pool.register(*args, **kwargs) + for args, kwargs in get_module_register_mixin(module_name): + Pool.register_mixin(*args, **kwargs) module = tools.import_module(module_name) - # Some modules register nothing in the Pool if hasattr(module, 'register'): + warnings.warn( + "register method is deprecated, " + f"use register in tryton.cfg of {module_name}", + DeprecationWarning) module.register() MODULES.append(module_name) diff --git a/trytond/trytond/pool.py b/trytond/trytond/pool.py index 9d8ab63780..5b0b7932cc 100644 --- a/trytond/trytond/pool.py +++ b/trytond/trytond/pool.py @@ -7,6 +7,7 @@ from threading import RLock, local from weakref import WeakSet from trytond.modules import load_modules, register_classes +from trytond.tools import resolve from trytond.transaction import Transaction __all__ = ['Pool', 'PoolMeta', 'PoolBase', 'isregisteredby'] @@ -43,7 +44,7 @@ class PoolBase(object, metaclass=PoolMeta): class Pool(object): - __slots__ = ('database_name', '_modules', '_pool', '__weakref__') + __slots__ = ('database_name', 'ready', '_modules', '_pool', '__weakref__') classes = { 'model': defaultdict(OrderedDict), @@ -65,11 +66,13 @@ class Pool(object): instances = cls._local.__dict__.setdefault('instances', {}) if (instance := instances.get(database_name)) is None: instances[database_name] = instance = super().__new__(cls) + instance.ready = False if instance not in cls._pool_instances: with cls._lock: instance._pool = cls._pools[database_name] instance._modules = cls._pool_modules[database_name] cls._pool_instances.add(instance) + instance.ready = True return instance def __init__(self, database_name=None): @@ -91,8 +94,9 @@ class Pool(object): for cls in classes: mpool = Pool.classes[type_][module] assert cls not in mpool, f"{cls} is already registered" - assert issubclass(cls.__class__, PoolMeta), ( - f"{cls} is missing metaclass {PoolMeta}") + assert isinstance(cls, str) \ + or issubclass(cls.__class__, PoolMeta), ( + f"{cls} is missing metaclass {PoolMeta}") mpool[cls] = depends @staticmethod @@ -134,6 +138,7 @@ class Pool(object): indexes is a boolean specifying if the indexes should be created ''' with self._lock: + self.ready = False if not self._started: self.start() logger.info('init pool for "%s"', self.database_name) @@ -149,6 +154,7 @@ class Pool(object): self._pool_instances.add(self) if restart: self.init() + self.ready = True def get(self, name, type='model'): ''' @@ -204,6 +210,13 @@ class Pool(object): for cls, depends in self.classes[type_].get(module, {}).items(): if not depends.issubset(modules): continue + if isinstance(cls, str): + if module in {'ir', 'res'}: + qualname = f'trytond.{module}.{cls}' + else: + qualname = f'trytond.modules.{module}.{cls}' + cls = resolve(qualname) + assert issubclass(cls.__class__, PoolMeta) try: previous_cls = self.get(cls.__name__, type=type_) cls = type( @@ -243,6 +256,17 @@ class Pool(object): if name is not None and kname != name: continue for parent, mixin in self.classes_mixin[module]: + if isinstance(parent, str): + try: + parent = resolve(parent) + except ImportError: + continue + if isinstance(mixin, str): + if module in {'ir', 'res'}: + qualname = f'trytond.{module}.{mixin}' + else: + qualname = f'trytond.modules.{module}.{mixin}' + mixin = resolve(qualname) if (not issubclass(cls, parent) or issubclass(cls, mixin)): continue @@ -258,6 +282,15 @@ class Pool(object): def isregisteredby(obj, module, type_='model'): + def resolve_if_needed(cls): + if isinstance(cls, str): + if module in {'ir', 'res'}: + qualname = f'trytond.{module}.{cls}' + else: + qualname = f'trytond.modules.{module}.{cls}' + cls = resolve(qualname) + return cls pool = Pool() classes = pool.classes[type_] - return any(issubclass(obj, cls) for cls in classes[module]) + return any( + issubclass(obj, resolve_if_needed(cls)) for cls in classes[module]) diff --git a/trytond/trytond/res/__init__.py b/trytond/trytond/res/__init__.py index 2dd3cc46dc..aed6e0e6c7 100644 --- a/trytond/trytond/res/__init__.py +++ b/trytond/trytond/res/__init__.py @@ -1,28 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.pool import Pool -from . import group, ir, routes, user +from . import routes -__all__ = ['register', 'routes'] - - -def register(): - Pool.register( - group.Group, - user.User, - user.LoginAttempt, - user.UserDevice, - user.UserAction, - user.UserGroup, - user.Warning_, - user.UserApplication, - user.UserConfigStart, - ir.Rule, - module='res', type_='model') - Pool.register( - user.UserConfig, - module="res", type_='wizard') - Pool.register( - user.EmailResetPassword, - module='res', type_='report') +__all__ = [routes] diff --git a/trytond/trytond/res/tryton.cfg b/trytond/trytond/res/tryton.cfg index 2584302b6b..88890797ba 100644 --- a/trytond/trytond/res/tryton.cfg +++ b/trytond/trytond/res/tryton.cfg @@ -6,3 +6,20 @@ xml: group.xml user.xml message.xml + +[register] +model: + ir.Rule + group.Group + user.User + user.LoginAttempt + user.UserDevice + user.UserAction + user.UserGroup + user.Warning_ + user.UserApplication + user.UserConfigStart +wizard: + user.UserConfig +report: + user.EmailResetPassword