diff --git a/README.md b/README.md index b95535e..1ce42aa 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ -# client_contracts +# Account Contracts +## Summary +Create and storage form for contracts. Generate a print form of document of contract. + +## Features +- Contract management: create, sign, close, renew +- Create .docx form of contract using any document template +- Fields in document fill from Odoo models diff --git a/__init__.py b/__init__.py index aa4d0fd..9b42961 100644 --- a/__init__.py +++ b/__init__.py @@ -1,4 +1,2 @@ -# -*- coding: utf-8 -*- - -from . import controllers from . import models +from . import wizard diff --git a/__manifest__.py b/__manifest__.py index 573b7c5..accd7ce 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,35 +1,24 @@ # -*- coding: utf-8 -*- { - 'name': "client_contracts", - - 'summary': """ - Module for storing and creating print forms for contracts with clients""", - - 'description': """ + "name": "client_contracts", + "summary": """ + Print forms for contracts with clients""", + "description": """ Module for storing and creating print forms for contracts with clients """, - - 'author': "RYDLAB", - 'website': "http://rydlab.ru", - - # Categories can be used to filter modules in modules listing - # Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml - # for the full list - 'category': 'hr', - 'version': '0.1', - - # any module necessary for this one to work correctly - 'depends': ['base', 'sale'], - - # always loaded - 'data': [ - # 'security/ir.model.access.csv', - 'views/templates.xml', - 'views/res_partner.xml', - 'views/contract_wizard.xml', - ], - # only loaded in demonstration mode - 'demo': [ - 'demo/demo.xml', + "author": "RYDLAB", + "website": "http://rydlab.ru", + "category": "Invoicing & Payments", + "version": "0.1.1", + "depends": ["base", "contacts", "russian_requisites", "sale",], + "data": [ + "data/fields_default.xml", + "data/payment_terms.xml", + "security/ir.model.access.csv", + "views/res_partner_contract.xml", + "views/res_partner_contract_annex.xml", + "views/res_partner.xml", + "views/sale_order.xml", + "wizard/res_partner_contract_wizard.xml", ], } diff --git a/controllers/__init__.py b/controllers/__init__.py deleted file mode 100644 index b0f26a9..0000000 --- a/controllers/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import controllers diff --git a/controllers/controllers.py b/controllers/controllers.py deleted file mode 100644 index eb3ea3a..0000000 --- a/controllers/controllers.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- - -from werkzeug import datastructures - -from odoo import http - - -class ResPartnerContractBinary(http.Controller): - - @http.route('/web/binary/get_compiled_contract') - def download_compiled_contract(self, doc_id, doc_name): - contract_wizard = http.request.env['res.partner.contract.wizard'].sudo().browse(int(doc_id)) - file_content = contract_wizard.get_docx_contract_1() - headers = datastructures.Headers() - headers.add('Content-Disposition', 'attachment', filename=doc_name) - return http.request.make_response(file_content, headers) diff --git a/data/fields_default.xml b/data/fields_default.xml new file mode 100644 index 0000000..10af36a --- /dev/null +++ b/data/fields_default.xml @@ -0,0 +1,346 @@ + + + + + + + Generate Context for Contract + + + code + + +# Aliases +self = record +partner = self.partner_id # res.partner +partner_bank = partner.bank_ids[0] # res.partner.bank +seller = self.company_id +seller_bank = seller.bank_ids[0] + +# ctx keys must be declared in this xml +ctx = { + "contract_number": self.name, + "date_conclusion": self.date_conclusion_fix or self.date_conclusion, + + "seller_company_name": seller.name, + "seller_business_address": seller.full_address, + "seller_representer_name": seller.representative_id.name, + "seller_representer_name_parent": seller.representative_id.name_parent_case, + "seller_representer_name_initials": seller.representative_id.name_initials_case, + "seller_representer_function": seller.representative_id.function, + "seller_representer_function_parent_case": seller.representative_id.function_parent_case, + "seller_inn": seller.inn, + "seller_kpp": seller.kpp, + "seller_bic": False, + "seller_ogrn": seller.psrn, + "seller_bank": False, + "seller_bank_account": False, + "seller_phone": partner.phone, + + "partner_company_name": partner.name, + "partner_business_address": partner.full_address, + "partner_representer_name": partner.representative_id.name, + "partner_representer_name_parent": partner.representative_id.name_parent_case, + "partner_representer_name_initials": partner.representative_id.name_initials_case, + "partner_representer_function": partner.representative_id.function, + "partner_representer_function_parent_case": partner.representative_id.function_parent_case, + "partner_inn": partner.inn, + "partner_kpp": partner.kpp, + "partner_bic": False, + "partner_ogrn": partner.psrn, + "partner_bank": False, + "partner_bank_account": False, + "partner_phone": partner.phone, +} + +if partner_bank: + ctx.update({ + "partner_bic": partner_bank.bank_id.bic, + "partner_bank": partner_bank.bank_id.name, + "partner_bank_account": partner_bank.acc_number, + }) + +if seller_bank: + ctx.update({ + "seller_bic": seller_bank.bank_id.bic, + "seller_bank": seller_bank.bank_id.name, + "seller_bank_account": seller_bank.acc_number, + }) + +action = ctx + + + + + + + Generate Context for Contract + + + code + + +# Aliases +self = record +order = self.order_id +seller = self.contract_id.company_id +partner = self.contract_id.partner_id + +# Functions +modf = self.modf + +# ctx keys must be decalared in this xml +ctx = { + "contract_number": self.contract_id.name, + + "amount_whole": 0, + "amount_fractional": 0, + + "payment_term": False, + "delivery_time": False, + + "seller_company_name": seller.name, + "seller_representer_name": seller.representative_id.name, + "seller_representer_function": seller.representative_id.function, + + "partner_company_name": partner.name, + "partner_representer_name": partner.representative_id.name, + "partner_representer_function": partner.representative_id.function, +} + +if order: + amount = modf(order.amount_total) + fractional, whole = amount + + payment_term = order.payment_term_id.name + payment_term = payment_term and payment_term.lower() + delivery_time = order.delivery_time + + ctx.update({ + "amount_whole": whole, + "amount_fractional": fractional, + + "payment_term": payment_term, + "delivery_time": delivery_time, + }) + +action = ctx + + + + + + + + Contract Number + contract_number + + + + + Conclusion Date + date_conclusion + + + + + Amount Whole Part + amount_whole + + + + + Amount Fractional Part + amount_fractional + + + + + Delivery Time + delivery_time + + + + + Payment Term + payment_term + + + + + + + + Seller Company Name + seller_company_name + + + + + Seller Business Address + seller_business_address + + + + + Seller Representer Name + seller_representer_name + + + + + Seller Representer Parent Name + seller_representer_name_parent + + + + + Seller Representer Initials Name + seller_representer_name_initials + + + + + + Seller Representer Function + seller_representer_function + + + + + Seller Representer Function Parent Case + seller_representer_function_parent_case + + + + + Seller INN + seller_inn + + + + + Seller KPP + seller_kpp + + + + + Seller BIC + seller_bic + + + + + Seller PSRN + seller_ogrn + + + + + Seller Bank Name + seller_bank + + + + + Seller Bank Account + seller_bank_account + + + + + Seller Phone + seller_phone + + + + + + + + Partner Company Name + partner_company_name + + + + + Partner Business Address + partner_business_address + + + + + Partner Representer Name + partner_representer_name + + + + + Partner Representer Parent Name + partner_representer_name_parent + + + + + Partner Representer Initials Name + partner_representer_name_initials + + + + + Partner Representer Function + partner_representer_function + + + + + Partner Representer Function Parent Case + partner_representer_function_parent_case + + + + + Partner INN + partner_inn + + + + + Partner KPP + partner_kpp + + + + + Partner BIC + partner_bic + + + + + Partner PSRN + partner_ogrn + + + + + Partner Bank Name + partner_bank + + + + + Partner Bank Account + partner_bank_account + + + + + Partner Phone + partner_phone + + + + + diff --git a/data/payment_terms.xml b/data/payment_terms.xml new file mode 100644 index 0000000..90c1822 --- /dev/null +++ b/data/payment_terms.xml @@ -0,0 +1,27 @@ + + + + + + 100% Prepaid + Payment terms: 100% Prepaid + 1 + + + 100% Postpaid + Payment terms: 100% Postpaid + 2 + + + 2 stages + Payment terms: Partial 2 Stages + 3 + + + 3 stages + Payment terms: Partial 3 Stages + 4 + + + + diff --git a/demo/demo.xml b/demo/demo.xml deleted file mode 100644 index 41cfe8a..0000000 --- a/demo/demo.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/i18n/ru.po b/i18n/ru.po new file mode 100644 index 0000000..1db272c --- /dev/null +++ b/i18n/ru.po @@ -0,0 +1,733 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * client_contracts +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0-20191106\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-12-25 11:27+0000\n" +"PO-Revision-Date: 2019-12-25 11:27+0000\n" +"Last-Translator: Stepan Savelyev\n" +"Language-Team: RYDLAB\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_count +#: model:ir.model.fields,field_description:client_contracts.field_res_users_contract_count +msgid "# of contracts" +msgstr "кол-во договоров" + +#. module: client_contracts +#: model:account.payment.term,name:client_contracts.payment_term_postpayment +msgid "100% Postpaid" +msgstr "100% постоплата" + +#. module: client_contracts +#: model:account.payment.term,name:client_contracts.payment_term_prepaid +msgid "100% Prepaid" +msgstr "100% предоплата" + +#. module: client_contracts +#: model:account.payment.term,name:client_contracts.payment_term_partial_2 +msgid "2 stages" +msgstr "Оплата в 2 этапа" + +#. module: client_contracts +#: model:account.payment.term,name:client_contracts.payment_term_partial_3 +msgid "3 stages" +msgstr "Оплата в 3 этапа" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_street_actual +#: model:ir.model.fields,field_description:client_contracts.field_res_users_street_actual +msgid "Actual Address" +msgstr "Актуальный адрес" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_amount_fractional +msgid "Amount Fractional Part" +msgstr "Дробная часть суммы" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_amount_whole +msgid "Amount Whole Part" +msgstr "Целая часть суммы" + +#. module: client_contracts +#: code:addons/client_contracts/wizard/res_partner_contract_wizard.py:145 +#: model:ir.ui.menu,name:client_contracts.res_partner_menu_contracts_templates_annex +#, python-format +msgid "Annex" +msgstr "Приложение" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_wizard_print_annex_view +msgid "Annex values" +msgstr "Поля в печатном приложении" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form +msgid "Annexed orders" +msgstr "Приложенные заказы" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_contract_annex_ids +msgid "Annexes" +msgstr "Приложения" + +#. module: client_contracts +#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_contract_annex_ids +msgid "Annexes to this contract" +msgstr "Приложения к договору" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_info_inherit_view +msgid "Banks" +msgstr "Банки" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_signature +msgid "Client signature" +msgstr "Подпись или печать" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form +msgid "Close" +msgstr "Закрыть" + +#. module: client_contracts +#: selection:res.partner.contract,state:0 +msgid "Closed" +msgstr "Закрыт" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_company_id +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_company_id +msgid "Company" +msgstr "Компания" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_date_conclusion +#: model:res.partner.contract.field,name:client_contracts.contract_field_contract_conclusion_date +msgid "Conclusion Date" +msgstr "Дата подписания" + +#. module: client_contracts +#: model:ir.model,name:client_contracts.model_res_partner +msgid "Contact" +msgstr "Контакт" + +#. module: client_contracts +#: code:addons/client_contracts/wizard/res_partner_contract_wizard.py:142 +#: model:ir.model,name:client_contracts.model_res_partner_contract +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_contract_id +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient__contract_wizard_id +#: model:ir.ui.menu,name:client_contracts.res_partner_menu_contracts +#: model:ir.ui.menu,name:client_contracts.res_partner_menu_contracts_templates_contract +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form +#: selection:res.partner.contract.wizard,target:0 +#, python-format +msgid "Contract" +msgstr "Договор" + +#. module: client_contracts +#: model:ir.model,name:client_contracts.model_res_partner_contract_annex +#: model:ir.model.fields,field_description:client_contracts.field_sale_order_contract_annex_id +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_annex_view_form +#: selection:res.partner.contract.wizard,target:0 +msgid "Contract Annex" +msgstr "Приложение к договору" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_contract_annex_number +msgid "Contract Annex Number" +msgstr "Счётчик приложений к договору" + +#. module: client_contracts +#: model:ir.model,name:client_contracts.model_res_partner_contract_field +msgid "Contract Field" +msgstr "Поле договора" + +#. module: client_contracts +#: model:ir.model,name:client_contracts.model_res_partner_contract_field_transient +msgid "Contract Field Transient" +msgstr "Фактическое поле договора" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_transient_field_ids +msgid "Contract Fields" +msgstr "Поля договора" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_contract_number +msgid "Contract Number" +msgstr "Номер договора" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_name +msgid "Contract number" +msgstr "Номер договора" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form +msgid "Contract parameters" +msgstr "Информация" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_wizard_print_contract_view +msgid "Contract values" +msgstr "Поля в печатном договоре" + +#. module: client_contracts +#: model:ir.actions.act_window,name:client_contracts.res_partner_contract_action +#: model:ir.actions.act_window,name:client_contracts.res_partner_contract_partner_action +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_client_contract_ids +#: model:ir.model.fields,field_description:client_contracts.field_res_users_client_contract_ids +#: model:ir.ui.menu,name:client_contracts.res_partner_contract_menu_act +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_tree +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_view_buttons +msgid "Contracts" +msgstr "Договоры" + +#. module: client_contracts +#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_contract_annex_number +msgid "Counter for generate Annex name" +msgstr "Счётчик для генерации имени приложения к договору" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_create_date_ts +msgid "Create Date Ts" +msgstr "Создан (таймстамп)" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_wizard_print_annex_view +#: model:ir.ui.view,arch_db:client_contracts.res_partner_wizard_print_contract_view +msgid "Create a document" +msgstr "Создать документ" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_create_uid +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_create_uid +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_create_uid +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient_create_uid +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_create_uid +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_annex_create_uid +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_create_uid +msgid "Created by" +msgstr "Создано" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_create_date +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_create_date +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_create_date +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient_create_date +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_create_date +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_annex_create_date +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_create_date +msgid "Created on" +msgstr "Создан" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_date_conclusion_fix +msgid "Date of manual conclusion" +msgstr "Дата подписания" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_date_conclusion +msgid "Date of system conclusion" +msgstr "Дата подписания системой" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_annex_is_default +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_is_default +msgid "Default Template" +msgstr "Default Template" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_delivery_time +#: model:ir.model.fields,field_description:client_contracts.field_sale_order_delivery_time +#: model:res.partner.contract.field,name:client_contracts.contract_field_delivery_time +msgid "Delivery Time" +msgstr "Срок доставки" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_description +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient_description +msgid "Description" +msgstr "Описание" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_display_name +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_display_name +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_display_name +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient_display_name +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_display_name +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_annex_display_name +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_display_name +msgid "Display Name" +msgstr "Отображаемое Имя" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient_contract_field_id +msgid "Field" +msgstr "Поле" + +#. module: client_contracts +#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_date_conclusion_fix +msgid "Field for manual edit when contract is signed or closed" +msgstr "Поле для ручного редактирования, когда договор подписан либо закрыт" + +#. module: client_contracts +#: model:ir.ui.menu,name:client_contracts.res_partner_menu_contracts_fields +msgid "Fields" +msgstr "Поля" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_full_address +#: model:ir.model.fields,field_description:client_contracts.field_res_users_full_address +msgid "Full Address" +msgstr "Полный адрес" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_function_parent_case +#: model:ir.model.fields,field_description:client_contracts.field_res_users_function_parent_case +msgid "Function Parent Case" +msgstr "Должность в родительном падеже" + +#. module: client_contracts +#: model:ir.actions.server,name:client_contracts.action_get_annex_context +#: model:ir.actions.server,name:client_contracts.action_get_contract_context +msgid "Generate Context for Contract" +msgstr "Generate Context for Contract" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_id +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_id +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient_id +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_id +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_id +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_annex_id +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_id +msgid "ID" +msgstr "Номер" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_wizard_print_annex_view +msgid "Info" +msgstr "Информация" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract___last_update +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex___last_update +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field___last_update +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient___last_update +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard___last_update +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_annex___last_update +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract___last_update +msgid "Last Modified on" +msgstr "Последнее изменение" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_write_uid +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient_write_uid +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_write_uid +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_write_uid +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_write_uid +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_annex_write_uid +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_write_uid +msgid "Last Updated by" +msgstr "Последний раз обновлено" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_write_date +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient_write_date +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_write_date +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_write_date +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_write_date +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_annex_write_date +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_write_date +msgid "Last Updated on" +msgstr "Последний раз обновлено" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_annex_view_form +msgid "Leave empty for compute" +msgstr "Оставить пустым для автозаполнения..." + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_name +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_name +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient_name +msgid "Name" +msgstr "Название" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_name_initials_case +#: model:ir.model.fields,field_description:client_contracts.field_res_users_name_initials_case +msgid "Name Initials Case" +msgstr "Фамилия с инициалами" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_name_parent_case +#: model:ir.model.fields,field_description:client_contracts.field_res_users_name_parent_case +msgid "Name Parent Case" +msgstr "Полное имя в родительном падеже" + +#. module: client_contracts +#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_field_technical_name +#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_field_transient_technical_name +msgid "Name uses in template" +msgstr "Имя поля, используемое в шаблоне" + +#. module: client_contracts +#: selection:res.partner.contract,state:0 +msgid "New" +msgstr "Новый" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_order_id +msgid "Order" +msgstr "Заказ" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_partner_id +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_partner_id +#: model:ir.ui.view,arch_db:client_contracts.res_partner_wizard_print_contract_view +msgid "Partner" +msgstr "Партнёр" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_bic +msgid "Partner BIC" +msgstr "БИК Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_bank_account +msgid "Partner Bank Account" +msgstr "Расчётный счёт Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_bank +msgid "Partner Bank Name" +msgstr "Наименование банка Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_business_address +msgid "Partner Business Address" +msgstr "Юридический адрёс Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_company_name +msgid "Partner Company Name" +msgstr "Наименование компании Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_inn +msgid "Partner INN" +msgstr "ИНН Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_kpp +msgid "Partner KPP" +msgstr "КПП Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_psrn +msgid "Partner PSRN" +msgstr "ОГРН Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_phone +msgid "Partner Phone" +msgstr "Телефон Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_representer_function +msgid "Partner Representer Function" +msgstr "Должность представителя Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_representer_function_parent_case +msgid "Partner Representer Function Parent Case" +msgstr "Должность представителя Партнёра в родительном падеже" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_representer_name_initials +msgid "Partner Representer Initials Name" +msgstr "Фамилия с инициалами представителя Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_representer_name +msgid "Partner Representer Name" +msgstr "Полное имя представителя Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_representer_name_parent +msgid "Partner Representer Parent Name" +msgstr "Полное имя в родительном падеже Партнёра" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_payment_term +msgid "Payment Term" +msgstr "Условия оплаты" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_payment_term +msgid "Payment Terms" +msgstr "Условия оплаты" + +#. module: client_contracts +#: model:account.payment.term,note:client_contracts.payment_term_postpayment +msgid "Payment terms: 100% Postpaid" +msgstr "Условия оплаты: постоплата" + +#. module: client_contracts +#: model:account.payment.term,note:client_contracts.payment_term_prepaid +msgid "Payment terms: 100% Prepaid" +msgstr "Условия оплаты: 100% предоплата" + +#. module: client_contracts +#: model:account.payment.term,note:client_contracts.payment_term_partial_2 +msgid "Payment terms: Partial 2 Stages" +msgstr "Условия оплаты: частично в 2 этапа" + +#. module: client_contracts +#: model:account.payment.term,note:client_contracts.payment_term_partial_3 +msgid "Payment terms: Partial 3 Stages" +msgstr "Условия оплаты: частично в 3 этапа" + +#. module: client_contracts +#: model:ir.model.fields,help:client_contracts.field_res_partner_representative_id +#: model:ir.model.fields,help:client_contracts.field_res_users_representative_id +msgid "Person, who represents company" +msgstr "Представитель компании" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_prepaid_expence +msgid "Prepaid Expence" +msgstr "Аванс" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_annex_view_form +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form +msgid "Print" +msgstr "Печать" + +#. module: client_contracts +#: code:addons/client_contracts/models/res_partner_contract.py:91 +#, python-format +msgid "Print Form of Contract" +msgstr "Форма печати договора" + +#. module: client_contracts +#: code:addons/client_contracts/models/res_partner_contract_annex.py:61 +#, python-format +msgid "Print Form of Contract Annex" +msgstr "Форма печати приложения к договору" + +#. module: client_contracts +#: model:ir.model,name:client_contracts.model_res_partner_template_print_contract +msgid "Print Template Contract" +msgstr "Вложение-шаблон договора" + +#. module: client_contracts +#: model:ir.model,name:client_contracts.model_res_partner_template_print_annex +msgid "Print Template Contract Annex" +msgstr "Вложение-шаблон приложения к договору" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_print_template_contract +msgid "Print Template of Contract" +msgstr "Шаблон-Вложение договора" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_print_template_annex +msgid "Print Template of Contract Annex" +msgstr "Шаблон-Вложение приложения к договору" + +#. module: client_contracts +#: model:ir.model,name:client_contracts.model_sale_order +msgid "Quotation" +msgstr "Предложение цен" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form +msgid "Renew" +msgstr "Возобновлено" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_representative_id +#: model:ir.model.fields,field_description:client_contracts.field_res_users_representative_id +msgid "Representative" +msgstr "Представитель" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_wizard_print_contract_view +msgid "Requisites" +msgstr "Реквизиты" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.search_res_partner_contract_filter +msgid "Search Contract" +msgstr "Поиск договора" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_wizard_print_contract_view +msgid "Seller" +msgstr "Продавец" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_bic +msgid "Seller BIC" +msgstr "БИК Продавца" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_bank_account +msgid "Seller Bank Account" +msgstr "Расчётный счёт Продавца" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_bank +msgid "Seller Bank Name" +msgstr "Наименование банка Продавца" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_business_address +msgid "Seller Business Address" +msgstr "Юридический адрес Продавца" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_company_name +msgid "Seller Company Name" +msgstr "Наименование компании Продавца" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_inn +msgid "Seller INN" +msgstr "ИНН Продавца" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_kpp +msgid "Seller KPP" +msgstr "КПП Продавца" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_psrn +msgid "Seller PSRN" +msgstr "ОГРН Продавца" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_phone +msgid "Seller Phone" +msgstr "Телефон Продавца" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_representer_function +msgid "Seller Representer Function" +msgstr "Должность представителя Продавца" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_representer_function_parent_case +msgid "Seller Representer Function Parent Case" +msgstr "Должность представителя Продавца в родительном падеже" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_representer_name_initials +msgid "Seller Representer Initials Name" +msgstr "Фамилия с инициалами представителя Продавца" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_representer_name +msgid "Seller Representer Name" +msgstr "Полное имя представителя Продавца" + +#. module: client_contracts +#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_representer_name_parent +msgid "Seller Representer Parent Name" +msgstr "Полное имя в родительном падеже Продавца" + +#. module: client_contracts +#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form +msgid "Sign" +msgstr "Подписано" + +#. module: client_contracts +#: selection:res.partner.contract,state:0 +msgid "Signed" +msgstr "Подписан" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_state +msgid "Status" +msgstr "Статус" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_target +msgid "Target" +msgstr "Ссылка" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_technical_name +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient_technical_name +msgid "Technical Name" +msgstr "Техническое название" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_annex_attachment_id +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_attachment_id +msgid "Template Attachment" +msgstr "Вложение-шаблон" + +#. module: client_contracts +#: model:ir.ui.menu,name:client_contracts.res_partner_menu_contracts_templates +msgid "Templates" +msgstr "Шаблоны" + +#. module: client_contracts +#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_annex_name +msgid "The Number of Annex" +msgstr "Номер приложения" + +#. module: client_contracts +#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient_value +msgid "Value" +msgstr "Значение" + +#. module: client_contracts +#: model:ir.model,name:client_contracts.model_res_partner_contract_annex_line +msgid "res.partner.contract.annex.line" +msgstr "res.partner.contract.annex.line" + +#. module: client_contracts +#: model:ir.model,name:client_contracts.model_res_partner_contract_annex_type +msgid "res.partner.contract.annex.type" +msgstr "res.partner.contract.annex.type" + +#. module: client_contracts +#: model:ir.actions.act_window,name:client_contracts.res_partner_contract_field_action +msgid "res.partner.contract.field.action" +msgstr "res.partner.contract.field.action" + +#. module: client_contracts +#: model:ir.model,name:client_contracts.model_res_partner_contract_template +msgid "res.partner.contract.template" +msgstr "res.partner.contract.template" + +#. module: client_contracts +#: model:ir.model,name:client_contracts.model_res_partner_contract_wizard +msgid "res.partner.contract.wizard" +msgstr "res.partner.contract.wizard" + +#. module: client_contracts +#: model:ir.actions.act_window,name:client_contracts.res_partner_print_annex_action +msgid "res.partner.template.print.annex.action" +msgstr "res.partner.template.print.annex.action" + +#. module: client_contracts +#: model:ir.actions.act_window,name:client_contracts.res_partner_print_contract_action +msgid "res.partner.template.print.contract.action" +msgstr "res.partner.template.print.contract.action" diff --git a/l18n/ru.po b/l18n/ru.po deleted file mode 100644 index ca90bf4..0000000 --- a/l18n/ru.po +++ /dev/null @@ -1,601 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * client_contracts -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-11-12 06:53+0000\n" -"PO-Revision-Date: 2018-11-12 06:53+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_partner_adress -msgid " Context Partner Adress" -msgstr " Адрес покупателя в договоре" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_count -#: model:ir.model.fields,field_description:client_contracts.field_res_users_contract_count -msgid "# of contracts" -msgstr "кол-во договоров" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form -msgid "Active" -msgstr "Актив" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_annex_lines -msgid "Annex Lines" -msgstr "Доп.условия" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_line_annex_type -msgid "Annex Type" -msgstr "Шаблоны доп.условий" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Annex info" -msgstr "Доп. условия" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Annex info lines" -msgstr "Строки доп.условий" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_type_description -msgid "Annex template description" -msgstr "Текст шаблона доп.условия" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_type_name -msgid "Annex template name" -msgstr "Название шаблона доп.условия" - -#. module: client_contracts -#: model:ir.ui.menu,name:client_contracts.res_partner_contract_annex_type_menu -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_annex_type_view -msgid "Annex type" -msgstr "Шаблон доп.условия" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form -msgid "Annexed orders" -msgstr "Приложенные заказы" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_order_ids -msgid "Annexes" -msgstr "Приложения" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_order_ids -msgid "Annexes to this contract" -msgstr "Заказы, приложенные к этому договору" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_wizard_order_id -msgid "Appex" -msgstr "Заказ-приложение" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_order_id -msgid "Appex order" -msgstr "Заказ-приложение" - -#. module: client_contracts -#: model:ir.actions.act_window,name:client_contracts.order_contract_tree -msgid "Appexes" -msgstr "Приложения" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_bank_account -#: model:ir.model.fields,field_description:client_contracts.field_res_users_bank_account -msgid "Bank account" -msgstr "Банковский счет" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_signature -msgid "Client signature" -msgstr "Подпись клиента/печать организации" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_company_id -msgid "Company" -msgstr "Компания" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Company values" -msgstr "Значения для продавца" - -#. module: client_contracts -#: model:ir.model,name:client_contracts.model_res_partner -msgid "Contact" -msgstr "Контакт" - -#. module: client_contracts -#: model:ir.actions.report,name:client_contracts.contract_appex_only_template_print -#: model:ir.actions.report,name:client_contracts.contract_company_template -#: model:ir.actions.report,name:client_contracts.contract_personal_template -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_contract_id -#: model:ir.model.fields,field_description:client_contracts.field_sale_order_contract_id -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Contract" -msgstr "Контракт" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_partner_id -msgid "Contract Partner" -msgstr "Покупатель" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_date -msgid "Contract date" -msgstr "Дата заключения договора" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_delivery_term -msgid "Contract delivery term" -msgstr "Сроки доставки" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_delivery_term_word -msgid "Contract delivery term word" -msgstr "Сроки доставки(прописью)" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_job_name -#: model:ir.model.fields,field_description:client_contracts.field_res_users_contract_job_name -msgid "Contract job name" -msgstr "Должность(в родительногм падеже)" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_name_5614 -#: model:ir.model.fields,field_description:client_contracts.field_res_users_contract_name -msgid "Contract name" -msgstr "ФИО/название(в родительном падеже)" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_name -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_name -msgid "Contract number" -msgstr "Номер договора" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form -msgid "Contract parameters" -msgstr "Параметры договора" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_partner_id -msgid "Contract partner" -msgstr "Покупатель" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_payment_term -msgid "Contract payment term" -msgstr "Срок оплаты" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_payment_term_word -msgid "Contract payment term word" -msgstr "Срок оплаты(прописью)" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_summ_word -msgid "Contract summ word" -msgstr "Сумма договора(прописью)" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_summ_kop -msgid "Contract summ(kop)" -msgstr "Сумма договора(копейки)" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_summ_rub -msgid "Contract summ(rub)" -msgstr "Сумма договора(рубли)" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_summ_rub_word -msgid "Contract summ(rub), word" -msgstr "Сумма договора(рубли, прописью)" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Contract values" -msgstr "Переменные для договора" - -#. module: client_contracts -#: model:ir.actions.act_window,name:client_contracts.res_partner_contract_wizard_action -msgid "Contract wizard" -msgstr "Формирование печатной формы договора" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_sale_order_contract_id -msgid "Contract, assigned to this order" -msgstr "Договора, привязанные к этому заказу" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_client_contract_ids -#: model:ir.model.fields,field_description:client_contracts.field_res_users_client_contract_ids -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_tree -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_view_buttons -msgid "Contracts" -msgstr "Договора" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_client_contract_ids -#: model:ir.model.fields,help:client_contracts.field_res_users_client_contract_ids -msgid "Contracts for this partner" -msgstr "Договора этого покупателя" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_line_create_uid -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_type_create_uid -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_create_uid -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_create_uid -msgid "Created by" -msgstr "Создано" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_line_create_date -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_type_create_date -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_create_date -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_create_date -msgid "Created on" -msgstr "Создан" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_date -msgid "Date of conclusion" -msgstr "Дата заключения" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_date -msgid "Date, when contract was concluded" -msgstr "Дата, когда договор был заключен" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Delivery and payment terms" -msgstr "Сроки поставки и оплаты" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_delivery_terms -msgid "Delivery terms" -msgstr "Сроки поставки" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_line_description -msgid "Description" -msgstr "Описание" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_line_display_name -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_type_display_name -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_display_name -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_template_display_name -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_display_name -msgid "Display Name" -msgstr "Отображаемое Имя" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Form DOCX from template" -msgstr "Сформировать DOCX из шаблона" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Form contract with company" -msgstr "Сформировать договор с фирмой" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Form contract with personal" -msgstr "Сформировать договор с частным лицом" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Form only appex contract" -msgstr "Сформировать только приложение" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_full_adress -#: model:ir.model.fields,field_description:client_contracts.field_res_users_full_adress -msgid "Full Adress" -msgstr "Полный адрес" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_line_id -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_type_id -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_id -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_template_id -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_id -msgid "ID" -msgstr "Номер" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_template_is_contract_template -msgid "Is Contract Template" -msgstr "Является шаблоном договора?" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_job_name -#: model:ir.model.fields,help:client_contracts.field_res_users_contract_job_name -msgid "Job position as it would be in contract" -msgstr "Название должности. как оно будет отображено в договоре" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract___last_update -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_line___last_update -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_type___last_update -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_template___last_update -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard___last_update -msgid "Last Modified on" -msgstr "Последнее изменение" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_line_write_uid -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_type_write_uid -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_template_write_uid -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_write_uid -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_write_uid -msgid "Last Updated by" -msgstr "Последний раз обновил" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_line_write_date -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_type_write_date -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_template_write_date -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_write_date -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_write_date -msgid "Last Updated on" -msgstr "Последнее обновление" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_name_5614 -#: model:ir.model.fields,help:client_contracts.field_res_users_contract_name -msgid "Name, as it would be in contract" -msgstr "ФИО, как оно будет отображено в договора" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_name -msgid "Number of contract, letters and digits" -msgstr "Номер договора. Генерируется автоматически" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Order info" -msgstr "Информация о заказе" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_partner_id -msgid "Partner" -msgstr "Партнёр" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_partner_bik -msgid "Partner bank bik" -msgstr "БИК банка покупателя" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_partner_bank -msgid "Partner bank name" -msgstr "Название банка покупателя" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_partner_contract_name -msgid "Partner contract name" -msgstr "ФИО покупателя(в родительном падеже)" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_partner_rs -msgid "Partner corresponding account" -msgstr "Рассчетный счет покупателя" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_partner_inn -msgid "Partner inn" -msgstr "ИНН покупателя" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_partner_kpp -msgid "Partner kpp" -msgstr "КПП покупателя" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Partner parameters" -msgstr "Параметры покупателя" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_partner_passport_data -msgid "Partner passport data" -msgstr "Паспортные данные покупателя" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_partner_phone -msgid "Partner phone" -msgstr "Телефон покупателя" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_partner_representer_name -msgid "Partner representer name" -msgstr "ФИО представителя покупателя" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_wizard_partner_id -msgid "Partner to render contract" -msgstr "Покупатель, с которым заключается контракт" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Partner values" -msgstr "Данные покупателя" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_passport_data -#: model:ir.model.fields,field_description:client_contracts.field_res_users_passport_data -msgid "Passport" -msgstr "Паспотрные данные" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_passport_data -#: model:ir.model.fields,help:client_contracts.field_res_users_passport_data -msgid "Passport data" -msgstr "Пасспортные данные" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_payment_terms -msgid "Payment term" -msgstr "Сроки оплаты" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_representative_id -#: model:ir.model.fields,help:client_contracts.field_res_users_representative_id -msgid "Person, who represents company" -msgstr "Человек, представляющий продавца/покупателя" - -#. module: client_contracts -#: model:ir.model,name:client_contracts.model_sale_order -msgid "Quotation" -msgstr "Оферта" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_representative_id -#: model:ir.model.fields,field_description:client_contracts.field_res_users_representative_id -msgid "Representative" -msgstr "Представитель" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.search_res_partner_contract_filter -msgid "Search Contract" -msgstr "Найти договор" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_seller_bik -msgid "Seller bank bik" -msgstr "БИК банка продавца" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_seller_bank -msgid "Seller bank name" -msgstr "Название банка продавца" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_wizard_company_id -msgid "Seller company" -msgstr "Компания-продавец" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_seller_contract_name -msgid "Seller contract name" -msgstr "Название продавца(в родительном падеже)" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_seller_rs -msgid "Seller corresponding account" -msgstr "Рассчетный счет продавца" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_seller_adress -msgid "Seller full adress" -msgstr "Полный адрес продавца" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_seller_inn -msgid "Seller inn" -msgstr "ИНН продавца" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_seller_kpp -msgid "Seller kpp" -msgstr "КПП продавца" - -#. module: client_contracts -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_wizard_view -msgid "Seller parameters" -msgstr "Параметры продавца" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_seller_phone -msgid "Seller phone" -msgstr "Телефон продавца" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_seller_representer_contract_job_name -msgid "Seller representer contract job name" -msgstr "Название должности представителя продавца(в родительном падеже)" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_seller_representer_contract_name -msgid "Seller representer contract name" -msgstr "ФИО представителя продавца(в родительном падеже)" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_seller_representer_job_name -msgid "Seller representer job name" -msgstr "Должность представителя продавца" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_seller_representer_name -msgid "Seller representer name" -msgstr "ФИО представителя продавца" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_template -#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_template_view -msgid "Template" -msgstr "Шаблон" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_wizard_template -msgid "Template for contract" -msgstr "Шаблон договора" - -#. module: client_contracts -#: model:ir.ui.menu,name:client_contracts.res_partner_contract_templates -msgid "Templates" -msgstr "Шаблоны" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_type -msgid "Type of contract" -msgstr "Тип договора" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_wizard_payment_terms -msgid "When customer must pay" -msgstr "Срок оплаты счета покупателем" - -#. module: client_contracts -#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_wizard_delivery_terms -msgid "When product must be delivered" -msgstr "Срок доставки товара покупателю" - -#. module: client_contracts -#: selection:res.partner.contract.wizard,type:0 -msgid "With company" -msgstr "С фирмой" - -#. module: client_contracts -#: selection:res.partner.contract.wizard,type:0 -msgid "With person" -msgstr "С частным лицом" - -#. module: client_contracts -#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard__context_partner_representer_contract_name -msgid "partner representer contract name" -msgstr "ФИО представителя покупателя(в родительном падеже)" diff --git a/models/__init__.py b/models/__init__.py index 57f6dd7..9be2ae2 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -1,3 +1,6 @@ -# -*- coding: utf-8 -*- - -from . import models, contract_wizard +from . import res_partner +from . import res_partner_contract +from . import res_partner_contract_annex +from . import res_partner_contract_field +from . import res_partner_contract_field_transient +from . import sale_order diff --git a/models/contract_wizard.py b/models/contract_wizard.py deleted file mode 100644 index d355b91..0000000 --- a/models/contract_wizard.py +++ /dev/null @@ -1,408 +0,0 @@ -# -*- coding: utf-8 -*- - -import math - -from datetime import datetime -from docxtpl import DocxTemplate -from pytils import numeral - -from odoo import models, fields, api -from odoo.tools.config import config - - -class AnnexLine(models.TransientModel): - _name = 'res.partner.contract.annex.line' - - @api.onchange('annex_type') - def _get_default_description(self): - self.description = self.annex_type.description - - annex_type = fields.Many2one('res.partner.contract.annex.type') - description = fields.Text() - - -class ContractWizard(models.TransientModel): - _name = 'res.partner.contract.wizard' - - def _get_default_template(self): - _template = self.env['res.partner.contract.template'].search([('is_contract_template', '=', True)]) - if _template: - return _template[0].id - else: - return False - - def _get_default_partner(self): - current_id = self.env.context.get('active_ids') - return self.env['res.partner.contract'].browse([current_id[0]]).partner_id.id - - def _get_default_contract(self): - current_id = self.env.context.get('active_ids') - return self.env['res.partner.contract'].browse(current_id[0]) - - def _get_partner_representer(self): - return self.partner_id.representative_id - - type = fields.Selection(string='Type of contract', - selection=[('person', 'With person'), ('company', 'With company')], - default='company') - - template = fields.Many2one('res.partner.contract.template', - string='Template', - help='Template for contract', - default=_get_default_template) - partner_id = fields.Many2one('res.partner', - string='Partner', - help='Partner to render contract', - default=_get_default_partner) - order_id = fields.Many2one('sale.order', - string='Appex order', - help='Appex', - ) - company_id = fields.Many2one('res.partner', - string='Company', - help='Seller company', - default=lambda self: self.env.user.company_id.partner_id) - - contract_id = fields.Many2one('res.partner.contract', - string='Contract', - default=_get_default_contract) - payment_terms = fields.Integer(string='Payment term', - help='When customer must pay', - default=45) - delivery_terms = fields.Integer(string='Delivery terms', - help='When product must be delivered', - default=10) - - annex_lines = fields.One2many('res.partner.contract.annex.line', 'id', auto_join=True, copy=True) - - @api.depends('contract_id') - def _compute_context_name(self): - self._context_name = self.contract_id.name - - @api.depends('contract_id') - def _compute_context_date(self): - contract_date = datetime.strptime(self.contract_id.date, '%Y-%m-%d') - self._context_date = contract_date.strftime('%d %B %Y') - - @api.depends('partner_id') - def _compute_context_partner_contract_name(self): - self._context_partner_contract_name = self.partner_id.contract_name - - @api.depends('partner_id') - def _compute_context_partner_adress(self): - self._compute_context_partner_adress = self.partner_id.full_adress - - @api.depends('partner_id') - def _compute_context_partner_representer_contract_name(self): - if self.partner_id.representative_id: - partner_representer_contract_name = self.partner_id.representative_id.contract_name - else: - partner_representer_contract_name = '' - self._context_partner_representer_contract_name = partner_representer_contract_name - - @api.depends('partner_id') - def _compute_context_partner_inn(self): - self._context_partner_inn = self.partner_id.inn - - @api.depends('partner_id') - def _compute_context_partner_kpp(self): - self._context_partner_kpp = self.partner_id.kpp - - @api.depends('partner_id') - def _compute_context_partner_rs(self): - self._context_partner_rs = self.partner_id.bank_account.acc_number - - @api.depends('partner_id') - def _compute_context_partner_bik(self): - self._context_partner_bik = self.partner_id.bank_account.bank_id.bic - - @api.depends('partner_id') - def _compute_context_partner_bank(self): - self._context_partner_bank = self.partner_id.bank_account.bank_id.name - - @api.depends('partner_id') - def _compute_context_partner_phone(self): - self._context_partner_phone = self.partner_id.phone - - @api.depends('partner_id') - def _compute_context_partner_representer_name(self): - self._context_partner_representer_name = self.partner_id.representative_id.name - - @api.depends('company_id') - def _compute_context_seller_contract_name(self): - self._context_seller_contract_name = self.company_id.contract_name - - @api.depends('company_id') - def _compute_context_seller_adress(self): - self._context_seller_adress = self.company_id.full_adress - - @api.depends('company_id') - def _compute_context_seller_representer_contract_job_name(self): - if self.company_id.representative_id: - seller_represent_contract_job_name = self.company_id.representative_id.contract_job_name - else: - seller_represent_contract_job_name = '' - self._context_seller_representer_contract_job_name = seller_represent_contract_job_name - - @api.depends('company_id') - def _compute_context_seller_representer_contract_name(self): - if self.company_id.representative_id: - seller_represent_contract_name = self.company_id.representative_id.contract_name - else: - seller_represent_contract_name = '' - self._context_seller_representer_contract_name = seller_represent_contract_name - - @api.depends('company_id') - def _compute_context_seller_inn(self): - self._context_seller_inn = self.company_id.inn - - @api.depends('company_id') - def _compute_context_seller_kpp(self): - self._context_seller_kpp = self.company_id.kpp - - @api.depends('company_id') - def _compute_context_seller_rs(self): - self._context_seller_rs = self.company_id.bank_account.acc_number - - @api.depends('company_id') - def _compute_context_seller_bik(self): - self._context_seller_bik = self.company_id.bank_account.bank_id.bic - - @api.depends('company_id') - def _compute_context_seller_bank(self): - self._context_seller_bank = self.company_id.bank_account.bank_id.name - - @api.depends('company_id') - def _compute_context_seller_phone(self): - self._context_seller_phone = self.company_id.phone - - @api.depends('company_id') - def _compute_context_seller_representer_job_name(self): - if self.company_id.representative_id: - seller_represent_job_name = self.company_id.representative_id.function - else: - seller_represent_job_name = '' - self._context_seller_representer_job_name = seller_represent_job_name - - @api.depends('company_id') - def _compute_context_seller_representer_name(self): - if self.company_id.representative_id: - seller_represent_name = self.company_id.representative_id.name - else: - seller_represent_name = '' - self._context_seller_representer_name = seller_represent_name - - @api.depends('order_id') - def _compute_context_summ_rub(self): - if self.order_id: - amount = math.modf(self.order_id.amount_total) - else: - amount = math.modf(0.0) - self._context_summ_rub = str(int(amount[1])) - - @api.depends('order_id') - def _compute_context_summ_rub_word(self): - if self.order_id: - amount = math.modf(self.order_id.amount_total) - else: - amount = math.modf(0.0) - self._context_summ_rub_word = numeral.in_words(int(amount[1])) - - @api.depends('order_id') - def _compute_context_summ_kop(self): - if self.order_id: - amount = math.modf(self.order_id.amount_total) - self._context_summ_kop = str(int(amount[0])) - else: - self._context_summ_kop = '0' - - @api.depends('order_id') - def _compute_context_summ_word(self): - self._context_summ_word = numeral.rubles(self.order_id.amount_total) - - @api.depends('delivery_terms') - def _compute_context_delivery_term(self): - self._context_delivery_term = self.delivery_terms - - @api.depends('delivery_terms') - def _compute_context_delivery_term_word(self): - self._context_delivery_term_word = numeral.in_words(self.delivery_terms) - - @api.depends('payment_terms') - def _compute_context_payment_term(self): - self._context_payment_term = self.payment_terms - - @api.depends('payment_terms') - def _compute_context_payment_term_word(self): - self._context_payment_term_word = numeral.in_words(self.payment_terms) - - _context_name = fields.Char(string='Contract number', compute='_compute_context_name', readonly=True) - _context_date = fields.Char(string='Contract date', compute='_compute_context_date', readonly=True) - _context_partner_contract_name = fields.Char(string='Partner contract name', - compute='_compute_context_partner_contract_name', readonly=True) - _context_partner_adress = fields.Char(compute='_compute_context_partner_adress', readonly=True) - _context_partner_representer_contract_name = fields.Char(string='partner representer contract name', - compute='_compute_context_partner_representer_contract_name', readonly=True) - _context_partner_inn = fields.Char(string='Partner inn', compute='_compute_context_partner_inn', readonly=True) - _context_partner_kpp = fields.Char(string='Partner kpp', compute='_compute_context_partner_kpp', readonly=True) - _context_partner_rs = fields.Char(string='Partner corresponding account', - compute='_compute_context_partner_rs', - readonly=True) - _context_partner_bik = fields.Char(string='Partner bank bik', - compute='_compute_context_partner_bik', - readonly=True) - _context_partner_bank = fields.Char(string='Partner bank name', - compute='_compute_context_partner_bank', - readonly=True) - _context_partner_phone = fields.Char(string='Partner phone', - compute='_compute_context_partner_phone', - readonly=True) - _context_partner_representer_name = fields.Char(string='Partner representer name', - compute='_compute_context_partner_representer_name', - readonly=True) - _context_seller_contract_name = fields.Char(string='Seller contract name', - compute='_compute_context_seller_contract_name', - readonly=True) - _context_seller_adress = fields.Char(string='Seller full adress', - compute='_compute_context_seller_adress', - readonly=True) - _context_seller_representer_contract_job_name = fields.Char(string='Seller representer contract job name', - compute='_compute_context_seller_representer_contract_job_name', readonly=True) - _context_seller_representer_contract_name = fields.Char(string='Seller representer contract name', - compute='_compute_context_seller_representer_contract_name', - readonly=True) - _context_seller_inn = fields.Char(string='Seller inn', compute='_compute_context_seller_inn', readonly=True) - _context_seller_kpp = fields.Char(string='Seller kpp', compute='_compute_context_seller_kpp', readonly=True) - _context_seller_rs = fields.Char(string='Seller corresponding account', - compute='_compute_context_seller_rs', - readonly=True) - _context_seller_bik = fields.Char(string='Seller bank bik', compute='_compute_context_seller_bik', readonly=True) - _context_seller_bank = fields.Char(string='Seller bank name', compute='_compute_context_seller_bank', readonly=True) - _context_seller_phone = fields.Char(string='Seller phone', compute='_compute_context_seller_phone', readonly=True) - _context_seller_representer_job_name = fields.Char(string='Seller representer job name', - compute='_compute_context_seller_representer_job_name', - readonly=True) - _context_seller_representer_name = fields.Char(string='Seller representer name', - compute='_compute_context_seller_representer_name', readonly=True) - _context_summ_rub = fields.Char(string='Contract summ(rub)', compute='_compute_context_summ_rub', readonly=True) - _context_summ_rub_word = fields.Char(string='Contract summ(rub), word', - compute='_compute_context_summ_rub_word', - readonly=True) - _context_summ_kop = fields.Char(string='Contract summ(kop)', compute='_compute_context_summ_kop', readonly=True) - _context_summ_word = fields.Char(string='Contract summ word', compute='_compute_context_summ_word', readonly=True) - _context_delivery_term = fields.Char(string='Contract delivery term', - compute='_compute_context_delivery_term', - readonly=True) - _context_delivery_term_word = fields.Char(string='Contract delivery term word', - compute='_compute_context_delivery_term_word', - readonly=True) - _context_payment_term = fields.Char(string='Contract payment term', - compute='_compute_context_payment_term', readonly=True) - _context_payment_term_word = fields.Char(string='Contract payment term word', - compute='_compute_context_payment_term_word', readonly=True) - _context_partner_passport_data = fields.Char(string='Partner passport data', - compute='_compute_partner_passport_data', - readonly=True) - - @api.onchange('partner_id') - def _compute_partner_passport_data(self): - return self.partner_id.passport_data - - @api.onchange('partner_id') - def _set_order_domain(self): - current_id = self.env.context.get('active_ids') - domain = [('contract_id', '=', current_id)] - return {'domain': {'order_id': domain}} - - def _generate_context(self): - contract_date = datetime.strptime(self.contract_id.date, '%Y-%m-%d') - if self.partner_id.representative_id: - partner_representer_contract_name = self.partner_id.representative_id.contract_name - else: - partner_representer_contract_name = '' - - if self.company_id.representative_id: - seller_represent_contract_name = self.company_id.representative_id.contract_name - seller_represent_contract_job_name = self.company_id.representative_id.contract_job_name - seller_represent_name = self.company_id.representative_id.name - seller_represent_job_name = self.company_id.representative_id.function - else: - seller_represent_contract_name = '' - seller_represent_contract_job_name = '' - seller_represent_name = '' - seller_represent_job_name = '' - - amount = math.modf(self.order_id.amount_total) - - order_goods = [] - counter = 1 - for line in self.order_id.order_line: - order_line_values = {'label': counter, - 'description': line.name, - 'count': line.product_qty, - 'mesure': line.product_uom.name, - 'price': line.price_unit, - 'amount': line.price_total} - order_goods.append(order_line_values) - counter += 1 - - annex_terms = '' - counter = 1 - for line in self.annex_lines: - annex_terms = annex_terms + '{}) {}\n'.format(counter, line.description) - counter += 1 - context = {'name': self.contract_id.name, - 'current_date': contract_date.strftime('%d %b %Y'), - 'partner_contract_name': self.partner_id.contract_name, - 'partner_adress': self.partner_id.full_adress, - 'partner_representer_contract_name': partner_representer_contract_name, - 'partner_inn': self.partner_id.inn, - 'partner_kpp': self.partner_id.kpp, - 'partner_rs': self.partner_id.bank_account.acc_number, - 'partner_bik': self.partner_id.bank_account.bank_id.bic, - 'partner_bank': self.partner_id.bank_account.bank_id.name, - 'partner_passport_data': self.partner_id.passport_data, - 'partner_phone': self.partner_id.phone, - 'partner_representer_name': self.partner_id.representative_id.name, - 'seller_contract_name': self.company_id.contract_name, - 'seller_adress': self.company_id.full_adress, - 'seller_representer_contract_job_name': seller_represent_contract_job_name, - 'seller_representer_contract_name': seller_represent_contract_name, - 'seller_inn': self.company_id.inn, - 'seller_kpp': self.company_id.kpp, - 'seller_rs': self.company_id.bank_account.acc_number, - 'seller_bik': self.company_id.bank_account.bank_id.bic, - 'seller_bank': self.company_id.bank_account.bank_id.name, - 'seller_phone': self.company_id.phone, - 'seller_representer_job_name': seller_represent_job_name, - 'seller_representer_name': seller_represent_name, - 'summ_rub': int(amount[1]), - 'summ_rub_word': numeral.in_words(int(amount[1])), - 'summ_kop': int(amount[0]), - 'delivery_term': self.delivery_terms, - 'delivery_term_word': numeral.in_words(self.delivery_terms), - 'payment_term': self.payment_terms, - 'payment_term_word': numeral.in_words(self.payment_terms), - 'annex_terms': annex_terms, - 'order_goods': order_goods, - } - return context - - def get_docx_contract_1(self): - odoo_data_dir = config.get("data_dir") - odoo_bd = config.get("db_name") - filename = self.template.store_fname - full_path = '{}/filestore/{}/{}'.format(odoo_data_dir, odoo_bd, filename) - context = self._generate_context() - doc = DocxTemplate(full_path) - doc.render(context) - doc.save('tmp.docx') - return open('tmp.docx', 'rb').read() - - def get_docx_contract(self): - return { - 'type': 'ir.actions.act_url', - 'url': '/web/binary/get_compiled_contract?doc_id={}&doc_name={}.docx'.format(self.id, - self.contract_id.name), - 'target': 'self', - } diff --git a/models/models.py b/models/models.py deleted file mode 100644 index cb10295..0000000 --- a/models/models.py +++ /dev/null @@ -1,118 +0,0 @@ -# -*- coding: utf-8 -*- - -from datetime import datetime - -from odoo import models, fields, api - - -class PartnerContract(models.Model): - - _name = 'res.partner.contract' - - name = fields.Char( - string='Contract number', - help='Number of contract, letters and digits',) - date = fields.Date( - string='Date of conclusion', - help='Date, when contract was concluded', - default=datetime.now().date(), - required=True) - partner_id = fields.Many2one( - 'res.partner', - string='Contract Partner', - help='Contract partner', - default=lambda self: self.env.context['active_id'], - required=True) - order_ids = fields.One2many( - 'sale.order', - 'contract_id', - string='Annexes', - help='Annexes to this contract') - - def _calculate_contract_name(self, _date): - contract_date = datetime.strptime(_date, '%Y-%m-%d') - date_part = contract_date.strftime('%d%m-%y') - today_contracts = self.search([('date', '=', contract_date.date())]) - if len(today_contracts) > 0: - last_contract_number = int(today_contracts[-1].name.split('-')[2]) + 1 - else: - last_contract_number = 1 - return '{}-{}'.format(date_part, last_contract_number) - - @api.onchange('date') - def _change_contract_name(self): - """ - Procedure for forming contract name - :return: contract name in format "DDMM-YY-№" - """ - - self.name = self._calculate_contract_name(self.date) - - @api.model - def create(self, vals): - datetime_now = datetime.now().strftime("%Y-%m-%d") - vals['name'] = self._calculate_contract_name(datetime_now) - return super(PartnerContract, self).create(vals) - - -class AnnexType(models.Model): - - _name = 'res.partner.contract.annex.type' - - name = fields.Char(string='Annex template name') - description = fields.Text(string='Annex template description') - - -class ResPartner(models.Model): - - _inherit = 'res.partner' - - client_contract_ids = fields.One2many( - 'res.partner.contract', - 'partner_id', - string='Contracts', - help='Contracts for this partner') - contract_count = fields.Integer( - compute='_compute_contract_count', - string='# of contracts') - contract_name = fields.Char(string='Contract name', help='Name, as it would be in contract') - contract_job_name = fields.Char(string='Contract job name', help='Job position as it would be in contract') - representative_id = fields.Many2one('res.partner', string='Representative', help='Person, who represents company') - passport_data = fields.Char(string='Passport', help='Passport data') - full_adress = fields.Char(compute='_compute_full_adress') - bank_account = fields.Many2one('res.partner.bank', string='Bank account') - signature = fields.Binary(string='Client signature') - - @api.one - @api.depends('street', 'street2', 'city', 'state_id', 'zip', 'country_id') - def _compute_full_adress(self): - if self.zip: - full_adress = '{}, {}, {}, {} {}'.format(self.zip, self.country_id.name, self.city, self.street, - self.street2) - else: - full_adress = '{}, {}, {} {}'.format(self.country_id.name, self.city, self.street, - self.street2) - self.full_adress = full_adress - - @api.one - @api.depends('self.client_contract_ids') - def _compute_contract_count(self): - self.contract_count = len(self.client_contract_ids) - - -class SaleOrder(models.Model): - - _inherit = 'sale.order' - - contract_id = fields.Many2one( - 'res.partner.contract', - string='Contract', - help='Contract, assigned to this order') - - -class ContractTemplate(models.Model): - - _name = 'res.partner.contract.template' - _inherit = 'ir.attachment' - - is_contract_template = fields.Boolean(srting='Is this document contract template?', default=True) diff --git a/models/res_partner.py b/models/res_partner.py new file mode 100644 index 0000000..8170d81 --- /dev/null +++ b/models/res_partner.py @@ -0,0 +1,46 @@ +from odoo import api, fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + name_parent_case = fields.Char(string="Name Parent Case",) + name_initials_case = fields.Char(string="Name Initials Case",) + function_parent_case = fields.Char(string="Function Parent Case",) + client_contract_ids = fields.One2many( + "res.partner.contract", "partner_id", string="Contracts", + ) + contract_count = fields.Integer( + compute="_compute_contract_count", string="# of contracts" + ) + full_address = fields.Char( + compute="_compute_full_address" + ) # Check for res.partner.contact_address in base/res + street_actual = fields.Many2one("res.partner", string="Actual Address",) + representative_id = fields.Many2one( + "res.partner", string="Representative", help="Person, who represents company" + ) + signature = fields.Binary(string="Client signature") + + @api.depends("street", "street2", "city", "state_id", "zip", "country_id") + def _compute_full_address(self): + for record in self: + data = filter( + None, + map( + lambda s: s and s.strip(), + [ + record.zip, + record.street, + record.street2, + record.country_id.name, + record.city, + ], + ), + ) + record.full_address = ", ".join(data) + + @api.one + @api.depends("self.client_contract_ids") + def _compute_contract_count(self): + self.contract_count = len(self.client_contract_ids) diff --git a/models/res_partner_contract.py b/models/res_partner_contract.py new file mode 100644 index 0000000..f35c6c8 --- /dev/null +++ b/models/res_partner_contract.py @@ -0,0 +1,118 @@ +import datetime + +from odoo import _, api, fields, models + + +class PartnerContract(models.Model): + _name = "res.partner.contract" + _description = "Contract" + _inherit = ["mail.thread", "mail.activity.mixin", "mail.followers"] + + def _get_default_name(self): + """Returns name format `№YYMM-D-N`, + where N is a sequence number of contracts which are created this day + """ + current_day_ts = ( + datetime.datetime.now() + .replace(minute=0, hour=0, second=0, microsecond=0) + .timestamp() + ) + partner = self.env["res.partner"].browse(self.env.context.get("active_id")) + + contracts_today = self.search( + [("partner_id", "=", partner.id), ("create_date_ts", ">=", current_day_ts),] + ) + + contract_date = "{format_date}-{number}".format( + format_date=datetime.date.strftime(datetime.date.today(), "%y%m-%d"), + number=len(contracts_today) + 1, + ) + return contract_date + + def _get_default_create_date_ts(self): + """Returns timestamp of now by local datetime""" + return datetime.datetime.now().timestamp() + + name = fields.Char(string="Contract number", default=_get_default_name,) + create_date_ts = fields.Char(default=_get_default_create_date_ts) + date_conclusion = fields.Date(string="Date of system conclusion",) + date_conclusion_fix = fields.Date( + string="Date of manual conclusion", + help="Field for manual edit when contract is signed or closed", + default=lambda self: self.date_conclusion, + ) + contract_annex_ids = fields.One2many( + "res.partner.contract.annex", + "contract_id", + string="Annexes", + help="Annexes to this contract", + ) + contract_annex_number = fields.Integer( + default=1, help="Counter for generate Annex name" + ) + partner_id = fields.Many2one( + "res.partner", + string="Partner", + default=lambda self: self.env.context.get("active_id"), + required=True, + ) + company_id = fields.Many2one( + "res.partner", + string="Company", + default=lambda self: self.env.user.company_id.partner_id, + ) + state = fields.Selection( + [("draft", "New"), ("sign", "Signed"), ("close", "Closed"),], + string="Status", + readonly=True, + copy=False, + index=True, + track_visibility="onchange", + track_sequence=3, + default="draft", + ) + + @api.multi + def action_sign(self): + self.write({"state": "sign", "date_conclusion": fields.Date.today()}) + + @api.multi + def action_close(self): + self.write({"state": "close"}) + + @api.multi + def action_renew(self): + self.write({"state": "draft"}) + + @api.multi + def action_print_form(self): + view = self.env.ref("client_contracts.res_partner_wizard_print_contract_view") + return { + "name": _("Print Form of Contract"), + "type": "ir.actions.act_window", + "res_model": "res.partner.contract.wizard", + "view_mode": "form", + "view_id": view.id, + "target": "new", + "context": {"self_id": self.id}, + } + + +class PrintTemplateContract(models.Model): + _name = "res.partner.template.print.contract" + _description = "Print Template Contract" + + attachment_id = fields.Many2one( + "ir.attachment", string="Template Attachment", required=True, + ) + is_default = fields.Boolean(string="Default Template", default=False,) + + +class PrintTemplateAnnex(models.Model): + _name = "res.partner.template.print.annex" + _description = "Print Template Contract Annex" + + attachment_id = fields.Many2one( + "ir.attachment", string="Template Attachment", required=True, + ) + is_default = fields.Boolean(string="Default Template", default=False,) diff --git a/models/res_partner_contract_annex.py b/models/res_partner_contract_annex.py new file mode 100644 index 0000000..4fd0dc7 --- /dev/null +++ b/models/res_partner_contract_annex.py @@ -0,0 +1,74 @@ +import math + +from odoo import _, api, fields, models + + +class ContractOrderAnnex(models.Model): + _name = "res.partner.contract.annex" + _description = "Contract Annex" + + name = fields.Char(string="Name", help="The Number of Annex") + order_id = fields.Many2one("sale.order", string="Order", required=True,) + contract_id = fields.Many2one( + "res.partner.contract", string="Contract", readonly=True, + ) + date_conclusion = fields.Date( + string="Conclusion Date", default=fields.Date.today(), + ) + prepaid_expence = fields.Float(string="Prepaid Expence", default=0) + delivery_time = fields.Integer(related="order_id.delivery_time", readonly=True,) + payment_term = fields.Many2one( + "account.payment.term", related="order_id.payment_term_id", readonly=True, + ) + + @api.onchange("contract_id") + def _onchange_contract_id(self): + # Compute name if there is no custom name + contract_number = self.contract_id.name + annex_number = self.contract_id.contract_annex_number + + self.name = "{contract}--{annex}".format( + contract=contract_number, annex=annex_number + ) + + # Compute domain for order_id because of bug with + # not working correctly domain in model + return { + "domain": { + "order_id": [ + ("partner_id", "=", self.contract_id.partner_id.id), + ("contract_annex_id", "=", False), + ] + } + } + + @api.model + def create(self, values): + record = super().create(values) + + # Fill annex_id to domain it in future + record.order_id.contract_annex_id = record.id + + # Add counter + record.contract_id.contract_annex_number += 1 + + return record + + @api.multi + def action_print_form(self): + view = self.env.ref("client_contracts.res_partner_wizard_print_annex_view") + return { + "name": _("Print Form of Contract Annex"), + "type": "ir.actions.act_window", + "res_model": "res.partner.contract.wizard", + "view_mode": "form", + "view_id": view.id, + "target": "new", + "context": {"self_id": self.id}, + } + + def modf(self, arg): + """Math.modf function for using in XML ir.action.server code + Uses in data/fields_default.xml + """ + return math.modf(arg) diff --git a/models/res_partner_contract_field.py b/models/res_partner_contract_field.py new file mode 100644 index 0000000..7a8dbcc --- /dev/null +++ b/models/res_partner_contract_field.py @@ -0,0 +1,12 @@ +from odoo import fields, models + + +class ContractField(models.Model): + _name = "res.partner.contract.field" + _description = "Contract Field" + + name = fields.Char(string="Name", required=True, translate=True,) + technical_name = fields.Char( + string="Technical Name", help="Name uses in template", required=True, + ) + description = fields.Char(string="Description", translate=True, default="",) diff --git a/models/res_partner_contract_field_transient.py b/models/res_partner_contract_field_transient.py new file mode 100644 index 0000000..43e214b --- /dev/null +++ b/models/res_partner_contract_field_transient.py @@ -0,0 +1,21 @@ +from odoo import fields, models + + +class ContractFieldTransient(models.TransientModel): + _name = "res.partner.contract.field.transient" + _description = "Contract Field Transient" + + _contract_wizard_id = fields.Many2one( + "res.partner.contract.wizard", string="Contract", readonly=True, + ) + contract_field_id = fields.Many2one("res.partner.contract.field", string="Field",) + name = fields.Char(related="contract_field_id.name", string="Name", readonly=True,) + technical_name = fields.Char( + related="contract_field_id.technical_name", + string="Technical Name", + readonly=True, + ) + description = fields.Char( + related="contract_field_id.description", string="Description", readonly=True, + ) + value = fields.Char(string="Value", default="",) diff --git a/models/sale_order.py b/models/sale_order.py new file mode 100644 index 0000000..ecee665 --- /dev/null +++ b/models/sale_order.py @@ -0,0 +1,26 @@ +from odoo import api, fields, models + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + delivery_time = fields.Integer(string="Delivery Time", default=45,) + contract_annex_id = fields.Many2one( + "res.partner.contract.annex", string="Contract Annex", readonly=True, + ) + # Extend default field + payment_term_id = fields.Many2one( + "account.payment.term", + domain=lambda self: [("id", "in", self._get_payment_terms())], + ) + + @api.multi + def _get_payment_terms(self): + ref = self.env.ref + terms = ( + ref("client_contracts.payment_term_prepaid").id, + ref("client_contracts.payment_term_postpayment").id, + ref("client_contracts.payment_term_partial_2").id, + ref("client_contracts.payment_term_partial_3").id, + ) + return terms diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv old mode 100644 new mode 100755 index ba1df10..764c070 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -1,2 +1,7 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_client_contracts_client_contracts,client_contracts.client_contracts,model_client_contracts_client_contracts,,1,0,0,0 \ No newline at end of file +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink + +access_contracts_contracts,access_contracts_contracts,model_res_partner_contract,base.group_user,1,1,1,1 +access_contracts_field,access_contracts_field,model_res_partner_contract_field,base.group_user,1,1,1,1 +access_contracts_field_contract_annex,access_contracts_field_contract_annex,model_res_partner_contract_annex,base.group_user,1,1,1,1 +access_contract_document_template,access_contract_document_template,model_res_partner_template_print_contract,base.group_user,1,1,1,1 +access_contract_annex_template,access_contract_annex_template,model_res_partner_template_print_annex,base.group_user,1,1,1,1 diff --git a/utils/__init__.py b/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/utils/docxtpl.py b/utils/docxtpl.py new file mode 100644 index 0000000..c3d46a9 --- /dev/null +++ b/utils/docxtpl.py @@ -0,0 +1,11 @@ +import io +from docxtpl import DocxTemplate + + +def get_document_from_values_stream(path_to_template: str, vals: dict): + doc = DocxTemplate(path_to_template) + doc.render(vals) + file_stream = io.BytesIO() + doc.save(file_stream) + file_stream.seek(0) + return file_stream diff --git a/views/contract_wizard.xml b/views/contract_wizard.xml deleted file mode 100644 index f8a6a9d..0000000 --- a/views/contract_wizard.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - Contract print wizard - res.partner.contract.wizard - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - res.partner.inherit - res.partner - - - - - - - - - - - - - - - annex_action - res.partner.contract.annex.type - form - tree,form,graph - + - - res_partner_contract_annex_type_view - res.partner.contract.annex.type - form - tree,form,graph - - - - - - - + - - res_partner_contract_template_action - res.partner.contract.template - form - tree,form,graph - + - - res_partner_contract_template_view - res.partner.contract.template - form - tree,form,graph - - - - - - - + - + - - -
\ No newline at end of file + diff --git a/views/res_partner_contract.xml b/views/res_partner_contract.xml new file mode 100644 index 0000000..c3f98f6 --- /dev/null +++ b/views/res_partner_contract.xml @@ -0,0 +1,99 @@ + + + + + + Contracts + res.partner.contract + + + + + + + + + + + + Contract Form + res.partner.contract + +
+
+
+ + + + + + + + + + + + + + + + + +
+
+
+ + + + + res.partner.contract.inherit.view.form + res.partner.contract + + + + +
+ + + +
+
+ +
+
+ + + + res_partner_contract_search + res.partner.contract + + + + + + + + + Contracts + res.partner.contract + form + tree,form + {} + + + + Contracts + res.partner.contract + form + tree,form + {'search_default_partner_id': active_id} + + +
diff --git a/views/res_partner_contract_annex.xml b/views/res_partner_contract_annex.xml new file mode 100644 index 0000000..5fa44a4 --- /dev/null +++ b/views/res_partner_contract_annex.xml @@ -0,0 +1,31 @@ + + + + + + + res.partner.contract.annex.view.form + res.partner.contract.annex + + +
+ + + + + + + + + + +