Merge branch 'development' into 'master'
Development See merge request tabulasense/client_contracts!10
This commit is contained in:
commit
a797555596
11
TODOLIST.md
Normal file
11
TODOLIST.md
Normal file
@ -0,0 +1,11 @@
|
||||
# TODO LIST
|
||||
|
||||
## Features
|
||||
|
||||
## Fixes
|
||||
- Change all `parents` to `genitive`
|
||||
- Merge `document_type` and `template_type` in `res.partner.document.template`
|
||||
- Change `annex_number` to `annex_counter`
|
||||
|
||||
## Big feature
|
||||
- Separate XML actions that generates transient fields for all types of documents
|
@ -12,12 +12,15 @@
|
||||
"version": "0.1.1",
|
||||
"depends": ["base", "contacts", "russian_requisites", "sale",],
|
||||
"data": [
|
||||
"data/assets_extension.xml",
|
||||
"data/document_templates.xml",
|
||||
"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_template_print.xml",
|
||||
"views/res_partner_contract_field.xml",
|
||||
"views/res_partner_document_template.xml",
|
||||
"views/res_partner.xml",
|
||||
"views/sale_order.xml",
|
||||
"wizard/res_partner_contract_wizard.xml",
|
||||
|
10
data/assets_extension.xml
Normal file
10
data/assets_extension.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<odoo>
|
||||
<data>
|
||||
<template id="assets_backend" name="im assets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<link rel="stylesheet" href="/client_contracts/static/src/css/mimetypes.css"/>
|
||||
</xpath>
|
||||
</template>
|
||||
</data>
|
||||
</odoo>
|
331
data/document_templates.xml
Normal file
331
data/document_templates.xml
Normal file
@ -0,0 +1,331 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- Original -->
|
||||
|
||||
<record id="document_contract_postavki_person" model="ir.attachment">
|
||||
<field name="name">Договор Поставки Исходный</field>
|
||||
<field name="datas_fname">Договор Поставки Исходный</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/contract_postavki.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_contract_postavki_person" model="res.partner.document.template">
|
||||
<field name="name">Договор Поставки Исходный</field>
|
||||
<field name="attachment_id" ref="document_contract_postavki_person"/>
|
||||
<field name="document_type"></field>
|
||||
<field name="document_type_name"></field>
|
||||
<field name="template_type"></field>
|
||||
<field name="company_type"></field>
|
||||
<field name="sequence">0</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Individual -->
|
||||
|
||||
<!-- Contract -->
|
||||
<record id="document_contract_postavki_person" model="ir.attachment">
|
||||
<field name="name">Договор Поставки Физлицо</field>
|
||||
<field name="datas_fname">Договор поставки</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/person/contract_postavki_person.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_contract_postavki_person" model="res.partner.document.template">
|
||||
<field name="name">Договор поставки</field>
|
||||
<field name="attachment_id" ref="document_contract_postavki_person"/>
|
||||
<field name="document_type">contract</field>
|
||||
<field name="document_type_name"></field>
|
||||
<field name="template_type">contract</field>
|
||||
<field name="company_type">person</field>
|
||||
<field name="sequence">10</field>
|
||||
</record>
|
||||
|
||||
<!-- Annexes -->
|
||||
<record id="document_bill_person" model="ir.attachment">
|
||||
<field name="name">Счёт Физлицо</field>
|
||||
<field name="datas_fname">Счёт</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/person/bill_person.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_bill_person" model="res.partner.document.template">
|
||||
<field name="name">Счёт</field>
|
||||
<field name="attachment_id" ref="document_bill_person"/>
|
||||
<field name="document_type">annex</field>
|
||||
<field name="document_type_name">bill</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">person</field>
|
||||
<field name="sequence">9</field>
|
||||
</record>
|
||||
|
||||
<record id="document_specification_person" model="ir.attachment">
|
||||
<field name="name">Спецификация Физлицо</field>
|
||||
<field name="datas_fname">Спецификация</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/person/specification_person.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_specification_person" model="res.partner.document.template">
|
||||
<field name="name">Спецификация</field>
|
||||
<field name="attachment_id" ref="document_specification_person"/>
|
||||
<field name="document_type">annex</field>
|
||||
<field name="document_type_name">specification</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">person</field>
|
||||
<field name="sequence">10</field>
|
||||
</record>
|
||||
|
||||
<record id="document_addition_list_soglasovania_person" model="ir.attachment">
|
||||
<field name="name">Лист согласования Физлицо</field>
|
||||
<field name="datas_fname">Лист согласования</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/person/addition_list_soglasovania_person.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_addition_list_soglasovania_person" model="res.partner.document.template">
|
||||
<field name="name">Лист согласования</field>
|
||||
<field name="attachment_id" ref="document_addition_list_soglasovania_person"/>
|
||||
<field name="document_type">addition</field>
|
||||
<field name="document_type_name">approval_list</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">person</field>
|
||||
<field name="sequence">20</field>
|
||||
</record>
|
||||
|
||||
<record id="document_addition_act_1_person" model="ir.attachment">
|
||||
<field name="name">Акт приема-передачи Физлицо</field>
|
||||
<field name="datas_fname">Акт приема-передачи</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/person/addition_act_1_person.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_addition_act_1_person" model="res.partner.document.template">
|
||||
<field name="name">Акт приема-передачи</field>
|
||||
<field name="attachment_id" ref="document_addition_act_1_person"/>
|
||||
<field name="document_type">addition</field>
|
||||
<field name="document_type_name">act_at</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">person</field>
|
||||
<field name="sequence">30</field>
|
||||
</record>
|
||||
|
||||
<record id="document_addition_act_2_person" model="ir.attachment">
|
||||
<field name="name">Акт приема-сдачи Физлицо</field>
|
||||
<field name="datas_fname">Акт приема-сдачи</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/person/addition_act_2_person.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_addition_act_2_person" model="res.partner.document.template">
|
||||
<field name="name">Акт приема-сдачи</field>
|
||||
<field name="attachment_id" ref="document_addition_act_2_person"/>
|
||||
<field name="document_type">addition</field>
|
||||
<field name="document_type_name">act_ad</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">person</field>
|
||||
<field name="sequence">40</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<!-- Sole Proprietor -->
|
||||
|
||||
<!-- Contract -->
|
||||
<record id="document_contract_postavki_sp" model="ir.attachment">
|
||||
<field name="name">Договор поставки ИП</field>
|
||||
<field name="datas_fname">Договор поставки</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/sp/contract_postavki_sp.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_contract_postavki_sp" model="res.partner.document.template">
|
||||
<field name="name">Договор поставки</field>
|
||||
<field name="attachment_id" ref="document_contract_postavki_sp"/>
|
||||
<field name="document_type">contract</field>
|
||||
<field name="document_type_name"></field>
|
||||
<field name="template_type">contract</field>
|
||||
<field name="company_type">sp</field>
|
||||
<field name="sequence">20</field>
|
||||
</record>
|
||||
|
||||
<!-- Annexes -->
|
||||
|
||||
<record id="document_specification_sp" model="ir.attachment">
|
||||
<field name="name">Спецификация ИП</field>
|
||||
<field name="datas_fname">Спецификация</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/sp/specification_sp.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_specification_sp" model="res.partner.document.template">
|
||||
<field name="name">Спецификация</field>
|
||||
<field name="attachment_id" ref="document_specification_sp"/>
|
||||
<field name="document_type">annex</field>
|
||||
<field name="document_type_name">specification</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">sp</field>
|
||||
<field name="sequence">10</field>
|
||||
</record>
|
||||
|
||||
<record id="document_bill_sp" model="ir.attachment">
|
||||
<field name="name">Счёт ИП</field>
|
||||
<field name="datas_fname">Счёт</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/sp/bill_sp.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_bill_sp" model="res.partner.document.template">
|
||||
<field name="name">Счёт</field>
|
||||
<field name="attachment_id" ref="document_bill_sp"/>
|
||||
<field name="document_type">annex</field>
|
||||
<field name="document_type_name">bill</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">sp</field>
|
||||
<field name="sequence">9</field>
|
||||
</record>
|
||||
|
||||
<record id="document_addition_list_soglasovania_sp" model="ir.attachment">
|
||||
<field name="name">Лист согласования ИП</field>
|
||||
<field name="datas_fname">Лист согласования</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/sp/addition_list_soglasovania_sp.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_addition_list_soglasovania_sp" model="res.partner.document.template">
|
||||
<field name="name">Лист согласования</field>
|
||||
<field name="attachment_id" ref="document_addition_list_soglasovania_sp"/>
|
||||
<field name="document_type">addition</field>
|
||||
<field name="document_type_name">approval_list</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">sp</field>
|
||||
<field name="sequence">20</field>
|
||||
</record>
|
||||
|
||||
<record id="document_addition_act_1_sp" model="ir.attachment">
|
||||
<field name="name">Акт приема-передачи ИП</field>
|
||||
<field name="datas_fname">Акт приема-передачи</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/sp/addition_act_1_sp.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_addition_act_1_sp" model="res.partner.document.template">
|
||||
<field name="name">Акт приема-передачи</field>
|
||||
<field name="attachment_id" ref="document_addition_act_1_sp"/>
|
||||
<field name="document_type">addition</field>
|
||||
<field name="document_type_name">act_at</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">sp</field>
|
||||
<field name="sequence">30</field>
|
||||
</record>
|
||||
|
||||
<record id="document_addition_act_2_sp" model="ir.attachment">
|
||||
<field name="name">Акт приема-сдачи ИП</field>
|
||||
<field name="datas_fname">Акт приема-сдачи</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/sp/addition_act_2_sp.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_addition_act_2_sp" model="res.partner.document.template">
|
||||
<field name="name">Акт приема-сдачи</field>
|
||||
<field name="attachment_id" ref="document_addition_act_2_sp"/>
|
||||
<field name="document_type">addition</field>
|
||||
<field name="document_type_name">act_ad</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">sp</field>
|
||||
<field name="sequence">40</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<!-- Private Limited Company -->
|
||||
|
||||
<!-- Contract -->
|
||||
<record id="document_contract_postavki_plc" model="ir.attachment">
|
||||
<field name="name">Договор поставки ООО</field>
|
||||
<field name="datas_fname">Договор поставки</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/plc/contract_postavki_plc.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_contract_postavki_plc" model="res.partner.document.template">
|
||||
<field name="name">Договор поставки</field>
|
||||
<field name="attachment_id" ref="document_contract_postavki_plc"/>
|
||||
<field name="document_type">contract</field>
|
||||
<field name="document_type_name"></field>
|
||||
<field name="template_type">contract</field>
|
||||
<field name="company_type">plc</field>
|
||||
<field name="sequence">30</field>
|
||||
</record>
|
||||
|
||||
<!-- Annexes -->
|
||||
<record id="document_specification_plc" model="ir.attachment">
|
||||
<field name="name">Спецификация ООО</field>
|
||||
<field name="datas_fname">Спецификация</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/plc/specification_plc.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_specification_plc" model="res.partner.document.template">
|
||||
<field name="name">Спецификация</field>
|
||||
<field name="attachment_id" ref="document_specification_plc"/>
|
||||
<field name="document_type">annex</field>
|
||||
<field name="document_type_name">specification</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">plc</field>
|
||||
<field name="sequence">10</field>
|
||||
</record>
|
||||
|
||||
<!-- Annexes -->
|
||||
<record id="document_bill_plc" model="ir.attachment">
|
||||
<field name="name">Счёт ООО</field>
|
||||
<field name="datas_fname">Счёт</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/plc/bill_plc.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_bill_plc" model="res.partner.document.template">
|
||||
<field name="name">Счёт</field>
|
||||
<field name="attachment_id" ref="document_bill_plc"/>
|
||||
<field name="document_type">annex</field>
|
||||
<field name="document_type_name">bill</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">plc</field>
|
||||
<field name="sequence">9</field>
|
||||
</record>
|
||||
|
||||
<record id="document_addition_list_soglasovania_plc" model="ir.attachment">
|
||||
<field name="name">Лист согласования ООО</field>
|
||||
<field name="datas_fname">Лист согласования</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/plc/addition_list_soglasovania_plc.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_addition_list_soglasovania_plc" model="res.partner.document.template">
|
||||
<field name="name">Лист согласования</field>
|
||||
<field name="attachment_id" ref="document_addition_list_soglasovania_plc"/>
|
||||
<field name="document_type">addition</field>
|
||||
<field name="document_type_name">approval_list</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">plc</field>
|
||||
<field name="sequence">20</field>
|
||||
</record>
|
||||
|
||||
<record id="document_addition_act_1_plc" model="ir.attachment">
|
||||
<field name="name">Акт приема-передачи ООО</field>
|
||||
<field name="datas_fname">Акт приема-передачи</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/plc/addition_act_1_plc.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_addition_act_1_plc" model="res.partner.document.template">
|
||||
<field name="name">Акт приема-передачи</field>
|
||||
<field name="attachment_id" ref="document_addition_act_1_plc"/>
|
||||
<field name="document_type">addition</field>
|
||||
<field name="document_type_name">act_at</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">plc</field>
|
||||
<field name="sequence">30</field>
|
||||
</record>
|
||||
|
||||
<record id="document_addition_act_2_plc" model="ir.attachment">
|
||||
<field name="name">Акт приема-сдачи ООО</field>
|
||||
<field name="datas_fname">Акт приема-сдачи</field>
|
||||
<field name="type">binary</field>
|
||||
<field name="datas" file="client_contracts/static/assets/documents/plc/addition_act_2_plc.docx" type="base64"/>
|
||||
</record>
|
||||
<record id="template_addition_act_2_plc" model="res.partner.document.template">
|
||||
<field name="name">Акт приема-сдачи</field>
|
||||
<field name="attachment_id" ref="document_addition_act_2_plc"/>
|
||||
<field name="document_type">addition</field>
|
||||
<field name="document_type_name">act_ad</field>
|
||||
<field name="template_type">annex</field>
|
||||
<field name="company_type">plc</field>
|
||||
<field name="sequence">40</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
@ -15,11 +15,14 @@ self = record
|
||||
|
||||
partner = self.partner_id # res.partner
|
||||
partner_bank = partner.bank_ids and partner.bank_ids[0] # res.partner.bank
|
||||
partner_bank_name = partner_bank.bank_id.name + (" г. {city}".format(city=partner_bank.bank_id.city) if partner_bank.bank_id.city else "")
|
||||
|
||||
seller = self.company_id
|
||||
seller_bank = seller.bank_ids and seller.bank_ids[0]
|
||||
seller_bank_name = seller_bank.bank_id.name + (" г. {city}".format(city=seller_bank.bank_id.city) if seller_bank.bank_id.city else "")
|
||||
|
||||
# Functions
|
||||
_ = self._
|
||||
get_date = self.get_date
|
||||
|
||||
# Parse date
|
||||
@ -35,6 +38,9 @@ yyyy = date.year
|
||||
yy = yyyy % 100
|
||||
MM = months[mm]
|
||||
|
||||
dd = dd if dd // 10 else '0{}'.format(dd)
|
||||
mm = mm if mm // 10 else '0{}'.format(mm)
|
||||
|
||||
# ctx keys must be decalared in this xml with id equal to "contract_field_{technical_name}"
|
||||
ctx = {
|
||||
"contract_number": self.name,
|
||||
@ -45,34 +51,42 @@ ctx = {
|
||||
"yy": yy,
|
||||
"yyyy": yyyy,
|
||||
|
||||
"seller_name": seller.name,
|
||||
"seller_name": seller.name_write,
|
||||
"seller_company_form": _(dict(seller._fields['company_form'].selection).get(seller.company_form)),
|
||||
"seller_representer_name": seller.representative_id.name,
|
||||
"seller_representer_name_parent": seller.representative_id.name_genitive,
|
||||
"seller_representer_name_initials": seller.representative_id.name_initials,
|
||||
"seller_representer_function": seller.representative_id.function,
|
||||
"seller_representer_function_parent": seller.representative_id.function_genitive,
|
||||
"seller_representer_document_parent": seller.representative_document,
|
||||
"seller_inn": seller.vat,
|
||||
"seller_kpp": seller.iec,
|
||||
"seller_ogrn": seller.psrn,
|
||||
"seller_business_address": seller.full_address,
|
||||
"seller_phone": seller.phone,
|
||||
"seller_whatsapp": seller.whatsapp,
|
||||
"seller_telegram": seller.telegram,
|
||||
"seller_email": seller.email,
|
||||
|
||||
"partner_name": partner.name,
|
||||
"partner_name": partner.name_write,
|
||||
"partner_inn": partner.vat,
|
||||
"partner_business_address": partner.full_address,
|
||||
"partner_phone": partner.phone,
|
||||
"partner_whatsapp": partner.whatsapp,
|
||||
"partner_telegram": partner.telegram,
|
||||
"partner_email": partner.email,
|
||||
}
|
||||
|
||||
if partner_bank:
|
||||
ctx.update({
|
||||
"partner_bank": partner_bank_name,
|
||||
"partner_rs": partner_bank.acc_number,
|
||||
"partner_ks": partner_bank.bank_id.corr_account,
|
||||
"partner_bic": partner_bank.bank_id.bic,
|
||||
})
|
||||
if seller_bank:
|
||||
ctx.update({
|
||||
"seller_bank": seller_bank_name,
|
||||
"seller_rs": seller_bank.acc_number,
|
||||
"seller_ks": seller_bank.bank_id.corr_account,
|
||||
"seller_bic": seller_bank.bank_id.bic,
|
||||
@ -82,11 +96,18 @@ if seller_bank:
|
||||
# Person
|
||||
if not partner.is_company:
|
||||
ctx.update({
|
||||
"partner_representer_name": partner.name_write,
|
||||
"partner_representer_name_initials": partner.name_initials,
|
||||
"partner_representer_passport_number": partner.passport_number,
|
||||
"partner_representer_passport_date": partner.passport_date,
|
||||
"partner_representer_passport_department": partner.passport_department,
|
||||
"partner_representer_passport_department_code": partner.passport_department_code,
|
||||
})
|
||||
if not partner.name_write:
|
||||
ctx.update({
|
||||
"partner_name": partner.name,
|
||||
"partner_representer_name": partner.name,
|
||||
})
|
||||
else:
|
||||
# Company
|
||||
ctx.update({
|
||||
@ -94,6 +115,8 @@ else:
|
||||
"partner_representer_name": partner.representative_id.name,
|
||||
"partner_representer_name_parent": partner.representative_id.name_genitive,
|
||||
"partner_representer_name_initials": partner.representative_id.name_initials,
|
||||
"partner_representer_function": partner.representative_id.function,
|
||||
"partner_representer_function_parent": partner.representative_id.function_genitive,
|
||||
"partner_representer_document_parent": partner.representative_document,
|
||||
})
|
||||
|
||||
@ -106,6 +129,7 @@ else:
|
||||
"partner_representer_passport_number": partner.representative_id.passport_number,
|
||||
"partner_representer_passport_date": partner.representative_id.passport_date,
|
||||
"partner_representer_passport_department": partner.representative_id.passport_department,
|
||||
"partner_representer_passport_department_code": partner.representative_id.passport_department_code,
|
||||
})
|
||||
if partner.company_form == 'plc':
|
||||
# Private Limited Company
|
||||
@ -131,13 +155,17 @@ action = ctx
|
||||
# Aliases
|
||||
self = record
|
||||
|
||||
seller = self.contract_id.company_id
|
||||
partner = self.contract_id.partner_id
|
||||
seller = self.company_id
|
||||
partner = self.partner_id
|
||||
|
||||
seller_bank = seller.bank_ids and seller.bank_ids[0]
|
||||
seller_bank_name = seller_bank.bank_id.name + (" г. {city}".format(city=seller_bank.bank_id.city) if seller_bank.bank_id.city else "")
|
||||
|
||||
partner_bank = partner.bank_ids and partner.bank_ids[0]
|
||||
partner_bank_name = partner_bank.bank_id.name + (" г. {city}".format(city=partner_bank.bank_id.city) if partner_bank.bank_id.city else "")
|
||||
|
||||
# Functions
|
||||
_ = self.contract_id._
|
||||
get_date = self.contract_id.get_date
|
||||
|
||||
# Parse date
|
||||
@ -153,21 +181,39 @@ yyyy = date.year
|
||||
yy = yyyy % 100
|
||||
MM = months[mm]
|
||||
|
||||
dd = dd if dd // 10 else '0{}'.format(dd)
|
||||
mm = mm if mm // 10 else '0{}'.format(mm)
|
||||
|
||||
order_date = self.parse_odoo_datetime(self.order_id.date_order)
|
||||
|
||||
# ctx keys must be decalared in this xml with id equal to "contract_field_{technical_name}"
|
||||
ctx = {
|
||||
"contract_number": self.contract_id.name,
|
||||
|
||||
"annex_name": self.name,
|
||||
"annex_number": self.counter,
|
||||
|
||||
"order_name": self.order_id.name,
|
||||
"order_date": "{} {} {}".format(order_date.day, months[order_date.month], order_date.year),
|
||||
|
||||
"payment_part_one": self.payment_part_one,
|
||||
"payment_part_two": self.payment_part_two,
|
||||
"payment_part_three": self.payment_part_three,
|
||||
"delivery_period": self.delivery_period,
|
||||
|
||||
"dd": dd,
|
||||
"mm": mm,
|
||||
"MM": MM,
|
||||
"yy": yy,
|
||||
"yyyy": yyyy,
|
||||
|
||||
"seller_name": seller.name,
|
||||
"seller_company_form": seller.read(["company_form"])[0]['company_form'],
|
||||
"seller_name": seller.name_write,
|
||||
"seller_company_form": _(dict(seller._fields['company_form'].selection).get(seller.company_form)),
|
||||
"seller_representer_name": seller.representative_id.name,
|
||||
"seller_representer_name_parent": seller.representative_id.name_genitive,
|
||||
"seller_representer_name_initials": seller.representative_id.name_initials,
|
||||
"seller_representer_function": seller.representative_id.function,
|
||||
"seller_representer_function_parent": seller.representative_id.function_genitive,
|
||||
|
||||
"seller_inn": seller.vat,
|
||||
"seller_kpp": seller.iec,
|
||||
@ -176,7 +222,7 @@ ctx = {
|
||||
"seller_phone": seller.phone,
|
||||
"seller_email": seller.email,
|
||||
|
||||
"partner_name": partner.name,
|
||||
"partner_name": partner.name_write,
|
||||
"partner_representer_name": partner.representative_id.name,
|
||||
"partner_representer_name_initials": partner.representative_id.name_initials,
|
||||
"partner_inn": partner.vat,
|
||||
@ -187,12 +233,14 @@ ctx = {
|
||||
|
||||
if partner_bank:
|
||||
ctx.update({
|
||||
"partner_bank": partner_bank_name,
|
||||
"partner_rs": partner_bank.acc_number,
|
||||
"partner_ks": partner_bank.bank_id.corr_account,
|
||||
"partner_bic": partner_bank.bank_id.bic,
|
||||
})
|
||||
if seller_bank:
|
||||
ctx.update({
|
||||
"seller_bank": seller_bank_name,
|
||||
"seller_rs": seller_bank.acc_number,
|
||||
"seller_ks": seller_bank.bank_id.corr_account,
|
||||
"seller_bic": seller_bank.bank_id.bic,
|
||||
@ -202,17 +250,25 @@ if seller_bank:
|
||||
# Person
|
||||
if not partner.is_company:
|
||||
ctx.update({
|
||||
"partner_representer_name": partner.name_write,
|
||||
"partner_representer_name_initials": partner.name_initials,
|
||||
"partner_representer_passport_number": partner.passport_number,
|
||||
"partner_representer_passport_date": partner.passport_date,
|
||||
"partner_representer_passport_department": partner.passport_department,
|
||||
})
|
||||
if not partner.name_write:
|
||||
ctx.update({
|
||||
"partner_name": partner.name,
|
||||
"partner_representer_name": partner.name,
|
||||
})
|
||||
else:
|
||||
# Company
|
||||
ctx.update({
|
||||
"partner_company_form": partner.read(["company_form"])[0]['company_form'],
|
||||
"partner_company_form": _(dict(partner._fields['company_form'].selection).get(partner.company_form)),
|
||||
"partner_representer_name_parent": partner.representative_id.name_genitive,
|
||||
"partner_representer_document_parent": partner.representative_document,
|
||||
"partner_representer_function": partner.representative_id.function,
|
||||
"partner_representer_function_parent": partner.representative_id.function_genitive,
|
||||
})
|
||||
|
||||
if partner.company_form == 'sp':
|
||||
@ -246,6 +302,35 @@ action = ctx
|
||||
<field name="sequence">1</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_annex_name" model="res.partner.contract.field">
|
||||
<field name="name">Annex Name</field>
|
||||
<field name="technical_name">annex_name</field>
|
||||
<field name="description"></field>
|
||||
<field name="sequence">2</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_annex_number" model="res.partner.contract.field">
|
||||
<field name="name">Annex Number</field>
|
||||
<field name="technical_name">annex_number</field>
|
||||
<field name="description"></field>
|
||||
<field name="sequence">2</field>
|
||||
<field name="visible">False</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_order_name" model="res.partner.contract.field">
|
||||
<field name="name">Order Name</field>
|
||||
<field name="technical_name">order_name</field>
|
||||
<field name="description"></field>
|
||||
<field name="sequence">3</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_order_date" model="res.partner.contract.field">
|
||||
<field name="name">Order Date</field>
|
||||
<field name="technical_name">order_date</field>
|
||||
<field name="description"></field>
|
||||
<field name="sequence">4</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_dd" model="res.partner.contract.field">
|
||||
<field name="name">Day</field>
|
||||
<field name="technical_name">dd</field>
|
||||
@ -258,6 +343,7 @@ action = ctx
|
||||
<field name="technical_name">mm</field>
|
||||
<field name="description">Number</field>
|
||||
<field name="sequence">16</field>
|
||||
<field name="visible">False</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_MM" model="res.partner.contract.field">
|
||||
@ -272,6 +358,7 @@ action = ctx
|
||||
<field name="technical_name">yy</field>
|
||||
<field name="description">Short</field>
|
||||
<field name="sequence">40</field>
|
||||
<field name="visible">False</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_yyyy" model="res.partner.contract.field">
|
||||
@ -293,16 +380,32 @@ action = ctx
|
||||
<field name="description"></field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_delivery_time" model="res.partner.contract.field">
|
||||
<field name="name">Delivery Time</field>
|
||||
<field name="technical_name">delivery_time</field>
|
||||
<record id="contract_field_payment_part_one" model="res.partner.contract.field">
|
||||
<field name="name">Payment Part 1</field>
|
||||
<field name="technical_name">payment_part_one</field>
|
||||
<field name="description"></field>
|
||||
<field name="sequence">35</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_payment_term" model="res.partner.contract.field">
|
||||
<field name="name">Payment Term</field>
|
||||
<field name="technical_name">payment_term</field>
|
||||
<record id="contract_field_payment_part_two" model="res.partner.contract.field">
|
||||
<field name="name">Payment Part 2</field>
|
||||
<field name="technical_name">payment_part_two</field>
|
||||
<field name="description"></field>
|
||||
<field name="sequence">36</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_payment_part_three" model="res.partner.contract.field">
|
||||
<field name="name">Payment Part 3</field>
|
||||
<field name="technical_name">payment_part_three</field>
|
||||
<field name="description"></field>
|
||||
<field name="sequence">37</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_delivery_period" model="res.partner.contract.field">
|
||||
<field name="name">Delivery Period</field>
|
||||
<field name="technical_name">delivery_period</field>
|
||||
<field name="description"></field>
|
||||
<field name="sequence">38</field>
|
||||
</record>
|
||||
|
||||
|
||||
@ -399,6 +502,13 @@ action = ctx
|
||||
<field name="sequence">144</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_seller_representer_passport_department_code" model="res.partner.contract.field">
|
||||
<field name="name">Passport Department Code</field>
|
||||
<field name="technical_name">seller_representer_passport_department_code</field>
|
||||
<field name="description">Seller Representative</field>
|
||||
<field name="sequence">146</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_seller_inn" model="res.partner.contract.field">
|
||||
<field name="name">INN</field>
|
||||
<field name="technical_name">seller_inn</field>
|
||||
@ -476,6 +586,20 @@ action = ctx
|
||||
<field name="sequence">232</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_seller_whatsapp" model="res.partner.contract.field">
|
||||
<field name="name">WhatsApp</field>
|
||||
<field name="technical_name">seller_whatsapp</field>
|
||||
<field name="description">Seller</field>
|
||||
<field name="sequence">233</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_seller_telegram" model="res.partner.contract.field">
|
||||
<field name="name">Telegram</field>
|
||||
<field name="technical_name">seller_telegram</field>
|
||||
<field name="description">Seller</field>
|
||||
<field name="sequence">234</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_seller_email" model="res.partner.contract.field">
|
||||
<field name="name">Email</field>
|
||||
<field name="technical_name">seller_email</field>
|
||||
@ -577,6 +701,13 @@ action = ctx
|
||||
<field name="sequence">344</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_partner_representer_passport_department_code" model="res.partner.contract.field">
|
||||
<field name="name">Passport Department Code</field>
|
||||
<field name="technical_name">partner_representer_passport_department_code</field>
|
||||
<field name="description">Partner Representative</field>
|
||||
<field name="sequence">346</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_partner_inn" model="res.partner.contract.field">
|
||||
<field name="name">INN</field>
|
||||
<field name="technical_name">partner_inn</field>
|
||||
@ -654,6 +785,20 @@ action = ctx
|
||||
<field name="sequence">432</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_partner_whatsapp" model="res.partner.contract.field">
|
||||
<field name="name">WhatsApp</field>
|
||||
<field name="technical_name">partner_whatsapp</field>
|
||||
<field name="description">Partner</field>
|
||||
<field name="sequence">433</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_partner_telegram" model="res.partner.contract.field">
|
||||
<field name="name">Telegram</field>
|
||||
<field name="technical_name">partner_telegram</field>
|
||||
<field name="description">Partner</field>
|
||||
<field name="sequence">434</field>
|
||||
</record>
|
||||
|
||||
<record id="contract_field_partner_email" model="res.partner.contract.field">
|
||||
<field name="name">Email</field>
|
||||
<field name="technical_name">partner_email</field>
|
||||
|
494
i18n/ru.po
494
i18n/ru.po
@ -6,10 +6,10 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 11.0-20191106\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-12-28 10:32+0000\n"
|
||||
"PO-Revision-Date: 2019-12-28 10:32+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"POT-Creation-Date: 2020-01-22 11:29+0000\n"
|
||||
"PO-Revision-Date: 2020-01-22 11:29+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"
|
||||
@ -41,6 +41,20 @@ msgstr "Оплата в 2 этапа"
|
||||
msgid "3 stages"
|
||||
msgstr "Оплата в 3 этапа"
|
||||
|
||||
#. module: client_contracts
|
||||
#: code:addons/client_contracts/models/res_partner_document_template.py:31
|
||||
#: selection:res.partner.document.template,document_type_name:0
|
||||
#, python-format
|
||||
msgid "Act of Acceptance and Delivery"
|
||||
msgstr "Акт сдачи-приемки"
|
||||
|
||||
#. module: client_contracts
|
||||
#: code:addons/client_contracts/models/res_partner_document_template.py:30
|
||||
#: selection:res.partner.document.template,document_type_name:0
|
||||
#, python-format
|
||||
msgid "Act of Acceptance and Transfer"
|
||||
msgstr "Акт приема-передачи"
|
||||
|
||||
#. 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
|
||||
@ -48,9 +62,11 @@ msgid "Actual Address"
|
||||
msgstr "Актуальный адрес"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,help:client_contracts.field_res_users_okpo
|
||||
msgid "All-Russian Classifier of Enterprises and Organizations"
|
||||
msgstr "Общероссийский классификатор предприятий и организаций"
|
||||
#: code:addons/client_contracts/models/res_partner_document_template.py:21
|
||||
#: selection:res.partner.document.template,document_type:0
|
||||
#, python-format
|
||||
msgid "Addition"
|
||||
msgstr "Дополнение"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_amount_fractional
|
||||
@ -63,21 +79,27 @@ msgid "Amount Whole Part"
|
||||
msgstr "Целая часть суммы"
|
||||
|
||||
#. module: client_contracts
|
||||
#: code:addons/client_contracts/wizard/res_partner_contract_wizard.py:139
|
||||
#: model:ir.ui.menu,name:client_contracts.res_partner_menu_contracts_templates_annex
|
||||
#: code:addons/client_contracts/models/res_partner_document_template.py:20
|
||||
#: selection:res.partner.document.template,document_type:0
|
||||
#: selection:res.partner.document.template,template_type:0
|
||||
#, 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 "Поля в печатном приложении"
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_annex_name
|
||||
msgid "Annex Name"
|
||||
msgstr "Наименование приложения"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_annex_number
|
||||
msgid "Annex Number"
|
||||
msgstr "Номер приложения"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form
|
||||
msgid "Annexed orders"
|
||||
msgstr "Приложенные заказы"
|
||||
msgid "Annexed Specifications"
|
||||
msgstr "Приложенные спецификации"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_contract_annex_ids
|
||||
@ -90,11 +112,11 @@ msgid "Annexes to this contract"
|
||||
msgstr "Приложения к договору"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_annex_name
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_name
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_name
|
||||
msgid "Attachment Name"
|
||||
msgstr "Название вложения"
|
||||
#: code:addons/client_contracts/models/res_partner_document_template.py:29
|
||||
#: selection:res.partner.document.template,document_type_name:0
|
||||
#, python-format
|
||||
msgid "Approval List"
|
||||
msgstr "Лист согласования"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_bic
|
||||
@ -124,6 +146,13 @@ msgstr "Наименование банка"
|
||||
msgid "Bank Payment Account"
|
||||
msgstr "Расчётный счёт"
|
||||
|
||||
#. module: client_contracts
|
||||
#: code:addons/client_contracts/models/res_partner_document_template.py:27
|
||||
#: selection:res.partner.document.template,document_type_name:0
|
||||
#, python-format
|
||||
msgid "Bill"
|
||||
msgstr "Счёт"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_business_address
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_business_address
|
||||
@ -146,15 +175,14 @@ msgid "Closed"
|
||||
msgstr "Закрыт"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_company_id
|
||||
#: 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_template_print_annex_company_type
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_company_type
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_company_type
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_document_template_company_type
|
||||
msgid "Company Type"
|
||||
msgstr "Тип компании"
|
||||
|
||||
@ -169,14 +197,15 @@ msgid "Contact"
|
||||
msgstr "Контакт"
|
||||
|
||||
#. module: client_contracts
|
||||
#: code:addons/client_contracts/wizard/res_partner_contract_wizard.py:136
|
||||
#: code:addons/client_contracts/models/res_partner_document_template.py:19
|
||||
#: 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
|
||||
#: selection:res.partner.document.template,document_type:0
|
||||
#: selection:res.partner.document.template,template_type:0
|
||||
#, python-format
|
||||
msgid "Contract"
|
||||
msgstr "Договор"
|
||||
@ -205,6 +234,7 @@ msgid "Contract Field Transient"
|
||||
msgstr "Фактическое поле договора"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.actions.act_window,name:client_contracts.res_partner_contract_field_action
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_transient_field_ids
|
||||
msgid "Contract Fields"
|
||||
msgstr "Поля договора"
|
||||
@ -224,11 +254,6 @@ msgstr "Номер договора"
|
||||
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
|
||||
@ -245,41 +270,46 @@ msgstr "Договоры"
|
||||
msgid "Counter for generate Annex name"
|
||||
msgstr "Счётчик для генерации имени приложения к договору"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_annex_counter
|
||||
msgid "Counter of Contract Annexes"
|
||||
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
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_wizard_print_document_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
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_create_uid
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_document_template_create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Создано"
|
||||
|
||||
#. module: client_contracts
|
||||
#: code:addons/client_contracts/models/res_partner_contract.py:40
|
||||
#: 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
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_create_date
|
||||
#, python-format
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_document_template_create_date
|
||||
msgid "Created on"
|
||||
msgstr "Создан"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_currency_id
|
||||
msgid "Currency"
|
||||
msgstr "Валюта"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_date_conclusion_fix
|
||||
msgid "Date of manual conclusion"
|
||||
@ -296,9 +326,27 @@ msgid "Day"
|
||||
msgstr "День"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_delivery_time
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_annex_view_form
|
||||
msgid "Delivery"
|
||||
msgstr "Доставка"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_delivery_address
|
||||
msgid "Delivery Address"
|
||||
msgstr "Адрес доставки"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_delivery_period
|
||||
msgid "Delivery Period"
|
||||
msgstr "Срок поставки"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_delivery_period
|
||||
msgid "Delivery Period (days)"
|
||||
msgstr "Срок поставки изделий"
|
||||
|
||||
#. module: client_contracts
|
||||
#: 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 "Срок доставки"
|
||||
|
||||
@ -308,24 +356,63 @@ msgstr "Срок доставки"
|
||||
msgid "Description"
|
||||
msgstr "Описание"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_annex_view_form
|
||||
msgid "Design"
|
||||
msgstr "Дизайн"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_design_cost
|
||||
msgid "Design Cost"
|
||||
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
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_display_name
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_document_template_display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Отображаемое Имя"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_document_template_document_type_name
|
||||
msgid "Document"
|
||||
msgstr "Документ"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_representer_document_parent
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_representer_document_parent
|
||||
msgid "Document Genitive"
|
||||
msgstr "Документ (род.падеж)"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_document_name
|
||||
msgid "Document Name"
|
||||
msgstr "Имя документа"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model,name:client_contracts.model_res_partner_document_template
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_document_template
|
||||
msgid "Document Template"
|
||||
msgstr "Шаблон документа"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.actions.act_window,name:client_contracts.res_partner_document_template_action
|
||||
msgid "Document Templates"
|
||||
msgstr "Шаблоны документов"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_design_doc_cost
|
||||
msgid "Documentation Design Cost"
|
||||
msgstr "Стоимость разработки КД"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_design_doc_period
|
||||
msgid "Documentation Design Period (days)"
|
||||
msgstr "Срок подготовки КД"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_email
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_email
|
||||
@ -365,8 +452,8 @@ msgid "Function"
|
||||
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
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_function_genitive
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_users_function_genitive
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_representer_function_parent
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_representer_function_parent
|
||||
msgid "Function Genitive"
|
||||
@ -382,10 +469,9 @@ msgstr "Generate Context for Contract"
|
||||
#: 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
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_id
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_document_template_id
|
||||
msgid "ID"
|
||||
msgstr "Номер"
|
||||
|
||||
@ -408,17 +494,47 @@ msgid "IP Number"
|
||||
msgstr "ИП Серия и номер"
|
||||
|
||||
#. module: client_contracts
|
||||
#: selection:res.partner.template.print,company_type:0
|
||||
#: selection:res.partner.template.print.annex,company_type:0
|
||||
#: selection:res.partner.template.print.contract,company_type:0
|
||||
#: model:ir.model.fields,help:client_contracts.field_res_partner_telegram
|
||||
#: model:ir.model.fields,help:client_contracts.field_res_users_telegram
|
||||
msgid "If a contact have a Telegram number or identifier"
|
||||
msgstr "Номер или идентификатор в Telegram"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,help:client_contracts.field_res_partner_whatsapp
|
||||
#: model:ir.model.fields,help:client_contracts.field_res_users_whatsapp
|
||||
msgid "If a contact have a WhatsApp number"
|
||||
msgstr "Номер в WhatsApp"
|
||||
|
||||
#. module: client_contracts
|
||||
#: selection:res.partner.document.template,company_type:0
|
||||
msgid "Individual"
|
||||
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_contract_annex_view_form
|
||||
msgid "Info"
|
||||
msgstr "Информация"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_annex_view_form
|
||||
msgid "Installation"
|
||||
msgstr "Монтаж"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_installation_address
|
||||
msgid "Installation Address"
|
||||
msgstr "Монтаж по адресу"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_installation_cost
|
||||
msgid "Installation Cost"
|
||||
msgstr "Стоимость монтажа"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_installation_period
|
||||
msgid "Installation Period (days)"
|
||||
msgstr "Срок монтажа изделий"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_company_form
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_company_form
|
||||
@ -437,9 +553,7 @@ msgstr "КПП"
|
||||
#: 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___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
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_document_template___last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Последнее изменение"
|
||||
|
||||
@ -448,22 +562,25 @@ msgstr "Последнее изменение"
|
||||
#: 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_template_print_annex_write_uid
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_write_uid
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_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_document_template_write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Последний раз обновлено"
|
||||
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_template_print_annex_write_date
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_write_date
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_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_document_template_write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Последний раз обновлено"
|
||||
msgstr "Последнее обновление"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model,name:client_contracts.model_crm_lead
|
||||
msgid "Lead/Opportunity"
|
||||
msgstr "Лид / Потенциальная сделка"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_annex_view_form
|
||||
@ -480,6 +597,8 @@ msgstr "Месяц"
|
||||
#: 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
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_document_template_name
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_name
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_representer_name
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_name
|
||||
@ -488,21 +607,32 @@ msgid "Name"
|
||||
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
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_name_genitive
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_users_name_genitive
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_representer_name_parent
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_representer_name_parent
|
||||
msgid "Name Genitive"
|
||||
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
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_name_initials
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_users_name_initials
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_representer_name_initials
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_representer_name_initials
|
||||
msgid "Name Initials"
|
||||
msgstr "Фамилия с инициалами"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_info_inherit_view
|
||||
msgid "Name in ERP"
|
||||
msgstr "Название в ERP"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_name_write
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_users_name_write
|
||||
msgid "Name in contracts"
|
||||
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
|
||||
@ -521,7 +651,6 @@ msgid "Number"
|
||||
msgstr "Число"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_users_okpo
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_okpo
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_okpo
|
||||
msgid "OKPO"
|
||||
@ -532,6 +661,21 @@ msgstr "ОКПО"
|
||||
msgid "Order"
|
||||
msgstr "Заказ"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_order_date
|
||||
msgid "Order Date"
|
||||
msgstr "Дата заказа"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_order_name
|
||||
msgid "Order Name"
|
||||
msgstr "Имя заказа"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_annex_order_id
|
||||
msgid "Orders with this partner which are not uses in annexes yet"
|
||||
msgstr "Заказы, заключённые с этим партнёром и ещё не использующиеся в приложениях"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_ogrn
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_ogrn
|
||||
@ -551,9 +695,9 @@ msgid "Parent Case"
|
||||
msgstr "В родительном падеже"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_partner_id
|
||||
#: 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
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_bank
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_bic
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_business_address
|
||||
@ -568,6 +712,8 @@ msgstr "В родительном падеже"
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_okpo
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_phone
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_rs
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_telegram
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_whatsapp
|
||||
msgid "Partner"
|
||||
msgstr "Партнёр"
|
||||
|
||||
@ -586,10 +732,17 @@ msgstr "Партнёр; Сертификат о регистрации ИП"
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_representer_name_parent
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_representer_passport_date
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_representer_passport_department
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_representer_passport_department_code
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_partner_representer_passport_number
|
||||
msgid "Partner Representative"
|
||||
msgstr "Представитель Партнёра"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_representer_passport_department_code
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_representer_passport_department_code
|
||||
msgid "Passport Department Code"
|
||||
msgstr "Код подразделения, выдавшего паспорт"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_representer_passport_department
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_representer_passport_department
|
||||
@ -609,14 +762,39 @@ msgid "Passport №"
|
||||
msgstr "Паспорт №"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_payment_term
|
||||
msgid "Payment Term"
|
||||
msgstr "Условия оплаты"
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_annex_view_form
|
||||
msgid "Payment"
|
||||
msgstr "Оплата"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_payment_term
|
||||
msgid "Payment Terms"
|
||||
msgstr "Условия оплаты"
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_payment_part_one
|
||||
msgid "Payment 1 Part (%)"
|
||||
msgstr "Оплата первой части в размере (%)"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_payment_part_two
|
||||
msgid "Payment 2 Part (%)"
|
||||
msgstr "Оплата второй части в размере (%)"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_payment_part_three
|
||||
msgid "Payment 3 Part (%)"
|
||||
msgstr "Оплата третьей части в размере (%)"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_payment_part_one
|
||||
msgid "Payment Part 1"
|
||||
msgstr "Оплата первой части (%)"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_payment_part_two
|
||||
msgid "Payment Part 2"
|
||||
msgstr "Оплата второй части (%)"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_payment_part_three
|
||||
msgid "Payment Part 3"
|
||||
msgstr "Оплата третьей части (%)"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:account.payment.term,note:client_contracts.payment_term_postpayment
|
||||
@ -651,24 +829,18 @@ msgid "Phone"
|
||||
msgstr "Телефон"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_prepaid_expense
|
||||
msgid "Prepaid Expense"
|
||||
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:95
|
||||
#: code:addons/client_contracts/models/res_partner_contract.py:99
|
||||
#, python-format
|
||||
msgid "Print Form of Contract"
|
||||
msgstr "Форма печати договора"
|
||||
|
||||
#. module: client_contracts
|
||||
#: code:addons/client_contracts/models/res_partner_contract_annex.py:63
|
||||
#: code:addons/client_contracts/models/res_partner_contract_annex.py:111
|
||||
#, python-format
|
||||
msgid "Print Form of Contract Annex"
|
||||
msgstr "Форма печати приложения к договору"
|
||||
@ -689,26 +861,19 @@ 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
|
||||
#: selection:res.partner.template.print,company_type:0
|
||||
#: selection:res.partner.template.print.annex,company_type:0
|
||||
#: selection:res.partner.template.print.contract,company_type:0
|
||||
#: selection:res.partner.document.template,company_type:0
|
||||
msgid "Private Limited Company"
|
||||
msgstr "Общество с ограниченной ответственностью"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_development_period
|
||||
msgid "Product Development Period (days)"
|
||||
msgstr "Срок разработки изделий"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model,name:client_contracts.model_sale_order
|
||||
msgid "Quotation"
|
||||
msgstr "Предложение цен"
|
||||
msgstr "Оферта"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_form
|
||||
@ -727,18 +892,12 @@ msgstr "Представитель"
|
||||
msgid "Representative acts on the basis of"
|
||||
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
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_bank
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_bic
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_business_address
|
||||
@ -753,6 +912,8 @@ msgstr "Поиск договора"
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_okpo
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_phone
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_rs
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_telegram
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_whatsapp
|
||||
msgid "Seller"
|
||||
msgstr "Продавец"
|
||||
|
||||
@ -771,12 +932,14 @@ msgstr "Продавец; Сертификат о регистрации ИП"
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_representer_name_parent
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_representer_passport_date
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_representer_passport_department
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_representer_passport_department_code
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_seller_representer_passport_number
|
||||
msgid "Seller Representative"
|
||||
msgstr "Представитель Продавца"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_sequence
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_document_template_sequence
|
||||
msgid "Sequence"
|
||||
msgstr "Нумерация"
|
||||
|
||||
@ -796,12 +959,22 @@ msgid "Signed"
|
||||
msgstr "Подписан"
|
||||
|
||||
#. module: client_contracts
|
||||
#: selection:res.partner.template.print,company_type:0
|
||||
#: selection:res.partner.template.print.annex,company_type:0
|
||||
#: selection:res.partner.template.print.contract,company_type:0
|
||||
#: selection:res.partner.document.template,company_type:0
|
||||
msgid "Sole Proprietor"
|
||||
msgstr "Индивидуальный предприниматель"
|
||||
|
||||
#. module: client_contracts
|
||||
#: code:addons/client_contracts/models/res_partner_document_template.py:28
|
||||
#: selection:res.partner.document.template,document_type_name:0
|
||||
#, python-format
|
||||
msgid "Specification"
|
||||
msgstr "Спецификация"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_specification_name
|
||||
msgid "Specification Name"
|
||||
msgstr "Имя спецификации"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_state
|
||||
msgid "Status"
|
||||
@ -819,27 +992,27 @@ msgid "Technical Name"
|
||||
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
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_telegram
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_users_telegram
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_telegram
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_telegram
|
||||
msgid "Telegram"
|
||||
msgstr "Telegram"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_wizard_print_document_view
|
||||
msgid "Template"
|
||||
msgstr "Шаблон"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_template_print_annex_view_form
|
||||
msgid "Template Annex"
|
||||
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_attachment_id
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_template_print_contract_attachment_id
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_document_template_attachment_id
|
||||
msgid "Template Attachment"
|
||||
msgstr "Вложение-шаблон"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_template_print_contract_view_form
|
||||
msgid "Template Contract"
|
||||
msgstr "Шаблон договора"
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_document_template_template_type
|
||||
msgid "Template Type"
|
||||
msgstr "Тип шаблона"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.ui.menu,name:client_contracts.res_partner_menu_contracts_templates
|
||||
@ -847,15 +1020,55 @@ 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 "Номер приложения"
|
||||
#: model:ir.model.fields,help:client_contracts.field_res_partner_name_write
|
||||
#: model:ir.model.fields,help:client_contracts.field_res_users_name_write
|
||||
msgid "This name uses in contracts"
|
||||
msgstr "Наименование, используемое при заполнении договоров"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_annex_total_cost
|
||||
msgid "Total Cost"
|
||||
msgstr "Общая стоимость"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_wizard_transient_field_ids_hidden
|
||||
msgid "Transient Field Ids Hidden"
|
||||
msgstr "Transient Field Ids Hidden"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_document_template_document_type
|
||||
msgid "Type of document"
|
||||
msgstr "Вид документа"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,help:client_contracts.field_res_partner_contract_annex_currency_id
|
||||
msgid "Utility field to express amount currency"
|
||||
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.ui.view,arch_db:client_contracts.res_partner_wizard_print_document_view
|
||||
msgid "Values"
|
||||
msgstr "Значения"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_transient_visible
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_contract_field_visible
|
||||
msgid "Visible"
|
||||
msgstr "Видимый"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_partner_whatsapp
|
||||
#: model:ir.model.fields,field_description:client_contracts.field_res_users_whatsapp
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_partner_whatsapp
|
||||
#: model:res.partner.contract.field,name:client_contracts.contract_field_seller_whatsapp
|
||||
msgid "WhatsApp"
|
||||
msgstr "WhatsApp"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:res.partner.contract.field,description:client_contracts.contract_field_MM
|
||||
msgid "Word"
|
||||
@ -868,24 +1081,9 @@ msgid "Year"
|
||||
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"
|
||||
#: model:ir.ui.view,arch_db:client_contracts.res_partner_contract_info_inherit_view
|
||||
msgid "i.e. Ural Bank for Reconstruction and Development"
|
||||
msgstr "напр. «Уральский банк реконструкции и развития»"
|
||||
|
||||
#. module: client_contracts
|
||||
#: model:ir.model,name:client_contracts.model_res_partner_contract_wizard
|
||||
@ -893,11 +1091,13 @@ 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"
|
||||
#: code:addons/client_contracts/models/res_partner_contract_annex.py:64
|
||||
#, python-format
|
||||
msgid "{name} from {date}"
|
||||
msgstr "{name} от {date}"
|
||||
|
||||
#. 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"
|
||||
#: code:addons/client_contracts/models/res_partner_contract.py:112
|
||||
#, python-format
|
||||
msgid "{type} {number} from {date}"
|
||||
msgstr "{type} {number} от {date}"
|
||||
|
@ -3,4 +3,5 @@ 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 res_partner_document_template
|
||||
from . import sale_order
|
||||
|
@ -4,6 +4,9 @@ from odoo import api, fields, models
|
||||
class ResPartner(models.Model):
|
||||
_inherit = "res.partner"
|
||||
|
||||
name_write = fields.Char(
|
||||
string="Name in contracts", help="This name uses in contracts",
|
||||
)
|
||||
name_genitive = fields.Char(string="Name Genitive",)
|
||||
name_initials = fields.Char(string="Name Initials",)
|
||||
function_genitive = fields.Char(string="Function Genitive",)
|
||||
@ -24,6 +27,12 @@ class ResPartner(models.Model):
|
||||
string="Representative acts on the basis of", help="Parent Case",
|
||||
)
|
||||
signature = fields.Binary(string="Client signature")
|
||||
whatsapp = fields.Char(
|
||||
string="WhatsApp", help="If a contact have a WhatsApp number",
|
||||
)
|
||||
telegram = fields.Char(
|
||||
string="Telegram", help="If a contact have a Telegram number or identifier",
|
||||
)
|
||||
|
||||
@api.depends("street", "street2", "city", "state_id", "zip", "country_id")
|
||||
def _compute_full_address(self):
|
||||
|
@ -1,12 +1,12 @@
|
||||
import datetime
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.tools.misc import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
|
||||
|
||||
from ..utils import MODULE_NAME
|
||||
from ..utils.misc import Extension, IDocument
|
||||
|
||||
|
||||
class PartnerContract(models.Model):
|
||||
class PartnerContract(models.Model, IDocument, Extension):
|
||||
_name = "res.partner.contract"
|
||||
_description = "Contract"
|
||||
_inherit = ["mail.thread", "mail.activity.mixin", "mail.followers"]
|
||||
@ -36,6 +36,7 @@ class PartnerContract(models.Model):
|
||||
"""Returns timestamp of now by local datetime"""
|
||||
return datetime.datetime.now().timestamp()
|
||||
|
||||
res_model = fields.Char(default=lambda self: self._name)
|
||||
name = fields.Char(string="Contract number", default=_get_default_name,)
|
||||
create_date = fields.Datetime(string="Created on")
|
||||
create_date_ts = fields.Char(default=_get_default_create_date_ts)
|
||||
@ -90,7 +91,9 @@ class PartnerContract(models.Model):
|
||||
|
||||
@api.multi
|
||||
def action_print_form(self):
|
||||
view = self.env.ref("{}.res_partner_wizard_print_contract_view".format(MODULE_NAME))
|
||||
view = self.env.ref(
|
||||
"{}.res_partner_wizard_print_document_view".format(MODULE_NAME)
|
||||
)
|
||||
return {
|
||||
"name": _("Print Form of Contract"),
|
||||
"type": "ir.actions.act_window",
|
||||
@ -101,6 +104,20 @@ class PartnerContract(models.Model):
|
||||
"context": {"self_id": self.id},
|
||||
}
|
||||
|
||||
def get_name_by_document_template(self, document_template_id):
|
||||
return self.name
|
||||
|
||||
def get_filename_by_document_template(self, document_template_id):
|
||||
return _("{type} {number} from {date}").format(
|
||||
type=_(
|
||||
dict(document_template_id._fields["document_type"].selection).get(
|
||||
document_template_id.document_type
|
||||
)
|
||||
),
|
||||
number=self.name,
|
||||
date=self.get_date().strftime("%d.%m.%Y"),
|
||||
)
|
||||
|
||||
def get_date(self):
|
||||
"""Uses in xml action (data/fields_default)
|
||||
|
||||
@ -109,37 +126,15 @@ class PartnerContract(models.Model):
|
||||
"""
|
||||
date = self.date_conclusion_fix or self.date_conclusion
|
||||
if date:
|
||||
date = datetime.datetime.strptime(date, DEFAULT_SERVER_DATE_FORMAT)
|
||||
date = self.parse_odoo_date(date)
|
||||
else:
|
||||
date = self.create_date
|
||||
date = datetime.datetime.strptime(date, DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
date = self.parse_odoo_datetime(self.create_date)
|
||||
return date
|
||||
|
||||
def _(self, arg):
|
||||
"""Uses in xml action (data/fields_default)
|
||||
|
||||
class PrintTemplate(models.Model):
|
||||
_name = "res.partner.template.print"
|
||||
_description = "Print Template"
|
||||
|
||||
name = fields.Char(related="attachment_id.name",)
|
||||
attachment_id = fields.Many2one(
|
||||
"ir.attachment", string="Template Attachment", required=True,
|
||||
)
|
||||
company_type = fields.Selection(
|
||||
selection=[
|
||||
("person", "Individual"),
|
||||
("sp", "Sole Proprietor"),
|
||||
("plc", "Private Limited Company"),
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
class PrintTemplateContract(models.Model):
|
||||
_name = "res.partner.template.print.contract"
|
||||
_inherit = "res.partner.template.print"
|
||||
_description = "Print Template Contract"
|
||||
|
||||
|
||||
class PrintTemplateAnnex(models.Model):
|
||||
_name = "res.partner.template.print.annex"
|
||||
_inherit = "res.partner.template.print"
|
||||
_description = "Print Template Contract Annex"
|
||||
Arguments:
|
||||
arg {str} -- String to translate
|
||||
"""
|
||||
return _(arg)
|
||||
|
@ -3,38 +3,74 @@ import math
|
||||
from odoo import _, api, fields, models
|
||||
|
||||
from ..utils import MODULE_NAME
|
||||
from ..utils.misc import Extension, IDocument
|
||||
|
||||
|
||||
class ContractOrderAnnex(models.Model):
|
||||
class ContractOrderAnnex(models.Model, IDocument, Extension):
|
||||
_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,)
|
||||
name = fields.Char(string="Name",)
|
||||
display_name = fields.Char(compute="_compute_display_name",)
|
||||
specification_name = fields.Char(compute="_compute_specification_name",)
|
||||
|
||||
contract_id = fields.Many2one(
|
||||
"res.partner.contract", string="Contract", readonly=True,
|
||||
)
|
||||
company_id = fields.Many2one("res.partner", related="contract_id.company_id",)
|
||||
partner_id = fields.Many2one("res.partner", related="contract_id.partner_id",)
|
||||
order_id = fields.Many2one(
|
||||
"sale.order",
|
||||
string="Order",
|
||||
help="Orders with this partner which are not uses in annexes yet",
|
||||
required=True,
|
||||
)
|
||||
date_conclusion = fields.Date(
|
||||
string="Conclusion Date", default=fields.Date.today(),
|
||||
)
|
||||
prepaid_expense = fields.Float(string="Prepaid Expense", 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,
|
||||
)
|
||||
counter = fields.Integer(string="№", help="Counter of Contract Annexes",)
|
||||
currency_id = fields.Many2one(related="company_id.currency_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
|
||||
development_period = fields.Integer("Product Development Period (days)",)
|
||||
|
||||
self.name = "{contract}--{annex}".format(
|
||||
contract=contract_number, annex=annex_number
|
||||
design_cost = fields.Monetary(string="Design Cost",)
|
||||
|
||||
design_doc_period = fields.Integer(string="Documentation Design Period (days)",)
|
||||
design_doc_cost = fields.Monetary(string="Documentation Design Cost",)
|
||||
|
||||
delivery_address = fields.Char(string="Delivery Address",)
|
||||
delivery_period = fields.Integer(string="Delivery Period (days)")
|
||||
|
||||
installation_address = fields.Char(string="Installation Address",)
|
||||
installation_period = fields.Integer(string="Installation Period (days)",)
|
||||
installation_cost = fields.Integer(string="Installation Cost",)
|
||||
|
||||
total_cost = fields.Monetary(string="Total Cost",)
|
||||
|
||||
payment_part_one = fields.Float(string="Payment 1 Part (%)", default=100)
|
||||
payment_part_two = fields.Float(string="Payment 2 Part (%)",)
|
||||
payment_part_three = fields.Float(string="Payment 3 Part (%)",)
|
||||
|
||||
@api.multi
|
||||
@api.depends("name")
|
||||
def _compute_display_name(self):
|
||||
for record in self:
|
||||
record.display_name = "№{} {}".format(
|
||||
record.counter or record.contract_id.contract_annex_number, record.name
|
||||
)
|
||||
|
||||
@api.depends("specification_name", "contract_id", "order_id")
|
||||
def _compute_specification_name(self):
|
||||
self.specification_name = _("{name} from {date}").format(
|
||||
name="{}-{}".format(self.contract_id.name, self.order_id.name),
|
||||
date=self.contract_id.get_date().strftime("%d.%m.%Y"),
|
||||
)
|
||||
|
||||
# Compute domain for order_id because of bug with
|
||||
# not working correctly domain in model
|
||||
@api.onchange("order_id")
|
||||
def _domain_order_id(self):
|
||||
"""Using domain function because of
|
||||
simple domain does not working properly because of
|
||||
contract_id is still False"""
|
||||
return {
|
||||
"domain": {
|
||||
"order_id": [
|
||||
@ -44,6 +80,15 @@ class ContractOrderAnnex(models.Model):
|
||||
}
|
||||
}
|
||||
|
||||
@api.onchange("order_id")
|
||||
def _onchange_order_id(self):
|
||||
contract_number = self.contract_id.name
|
||||
order_number = self.order_id.name or "SO###"
|
||||
|
||||
self.name = "{contract}-{order}".format(
|
||||
contract=contract_number, order=order_number,
|
||||
)
|
||||
|
||||
@api.model
|
||||
def create(self, values):
|
||||
record = super().create(values)
|
||||
@ -51,14 +96,17 @@ class ContractOrderAnnex(models.Model):
|
||||
# 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
|
||||
# Counter
|
||||
record.counter = record.contract_id.contract_annex_number
|
||||
record.contract_id.contract_annex_number += 1 # TODO: should I use a sequence?
|
||||
|
||||
return record
|
||||
|
||||
@api.multi
|
||||
def action_print_form(self):
|
||||
view = self.env.ref("{}.res_partner_wizard_print_annex_view".format(MODULE_NAME))
|
||||
view = self.env.ref(
|
||||
"{}.res_partner_wizard_print_document_view".format(MODULE_NAME)
|
||||
)
|
||||
return {
|
||||
"name": _("Print Form of Contract Annex"),
|
||||
"type": "ir.actions.act_window",
|
||||
@ -69,6 +117,44 @@ class ContractOrderAnnex(models.Model):
|
||||
"context": {"self_id": self.id},
|
||||
}
|
||||
|
||||
def get_name_by_document_template(self, document_template_id):
|
||||
return (
|
||||
{
|
||||
"specification": "{counter} {name}",
|
||||
"approval_list": "{counter}.1 {name}-1",
|
||||
"act_at": "{counter}.2 {name}-2",
|
||||
"act_ad": "{counter}.3 {name}-3",
|
||||
}
|
||||
.get(document_template_id.document_type_name, "Unknown")
|
||||
.format(counter=self.counter, name=self.name,)
|
||||
)
|
||||
|
||||
def get_filename_by_document_template(self, document_template_id):
|
||||
return "{type} №{name}".format(
|
||||
type=_(
|
||||
dict(document_template_id._fields["document_type"].selection).get(
|
||||
document_template_id.document_type
|
||||
)
|
||||
),
|
||||
name={
|
||||
"bill": "{counter} {type} {name}",
|
||||
"specification": "{counter} {type} {name}",
|
||||
"approval_list": "{counter}.1 {type} {name}-1",
|
||||
"act_at": "{counter}.2 {type} {name}-2",
|
||||
"act_ad": "{counter}.3 {type} {name}-3",
|
||||
}
|
||||
.get(document_template_id.document_type_name)
|
||||
.format(
|
||||
counter=self.counter,
|
||||
type=_(
|
||||
dict(
|
||||
document_template_id._fields["document_type_name"].selection
|
||||
).get(document_template_id.document_type_name)
|
||||
),
|
||||
name=self.name,
|
||||
),
|
||||
)
|
||||
|
||||
def modf(self, arg):
|
||||
"""Math.modf function for using in XML ir.action.server code
|
||||
Uses in data/fields_default.xml
|
||||
|
@ -11,3 +11,4 @@ class ContractField(models.Model):
|
||||
)
|
||||
description = fields.Char(string="Description", translate=True, default="",)
|
||||
sequence = fields.Integer(string="Sequence",)
|
||||
visible = fields.Boolean(string="Visible", default=True,)
|
||||
|
@ -18,4 +18,5 @@ class ContractFieldTransient(models.TransientModel):
|
||||
description = fields.Char(
|
||||
related="contract_field_id.description", string="Description", readonly=True,
|
||||
)
|
||||
visible = fields.Boolean(related="contract_field_id.visible",)
|
||||
value = fields.Char(string="Value", default="",)
|
||||
|
44
models/res_partner_document_template.py
Normal file
44
models/res_partner_document_template.py
Normal file
@ -0,0 +1,44 @@
|
||||
from odoo import _, fields, models
|
||||
|
||||
|
||||
class DocumentTemplate(models.Model):
|
||||
_name = "res.partner.document.template"
|
||||
_description = "Document Template"
|
||||
_order = "company_type,document_type,sequence"
|
||||
|
||||
name = fields.Char()
|
||||
attachment_id = fields.Many2one(
|
||||
"ir.attachment",
|
||||
string="Template Attachment",
|
||||
ondelete="cascade",
|
||||
required=True,
|
||||
)
|
||||
document_type = fields.Selection(
|
||||
string="Type of document",
|
||||
selection=[
|
||||
("contract", _("Contract")),
|
||||
("annex", _("Annex")),
|
||||
("addition", _("Addition")),
|
||||
],
|
||||
)
|
||||
document_type_name = fields.Selection(
|
||||
string="Document",
|
||||
selection=[
|
||||
("bill", _("Bill")),
|
||||
("specification", _("Specification")),
|
||||
("approval_list", _("Approval List")),
|
||||
("act_at", _("Act of Acceptance and Transfer")),
|
||||
("act_ad", _("Act of Acceptance and Delivery")),
|
||||
],
|
||||
)
|
||||
company_type = fields.Selection(
|
||||
selection=[
|
||||
("person", "Individual"),
|
||||
("sp", "Sole Proprietor"),
|
||||
("plc", "Private Limited Company"),
|
||||
]
|
||||
)
|
||||
template_type = fields.Selection(
|
||||
selection=[("contract", "Contract"), ("annex", "Annex"),]
|
||||
)
|
||||
sequence = fields.Integer()
|
@ -4,5 +4,4 @@ access_contracts_contracts,access_contracts_contracts,model_res_partner_contract
|
||||
access_contracts_field,access_contracts_field,model_res_partner_contract_field,base.group_user,1,0,0,0
|
||||
access_contracts_field_transient,access_contracts_field_transient,model_res_partner_contract_field_transient,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,0,0,0
|
||||
access_contract_annex_template,access_contract_annex_template,model_res_partner_template_print_annex,base.group_user,1,0,0,0
|
||||
access_contract_document_template,access_contract_document_template,model_res_partner_document_template,base.group_user,1,0,0,0
|
||||
|
|
BIN
static/assets/documents/bill.docx
Normal file
BIN
static/assets/documents/bill.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/common/bill.docx
Normal file
BIN
static/assets/documents/common/bill.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/contract_postavki.docx
Normal file
BIN
static/assets/documents/contract_postavki.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/original/Акт приема-передачи.docx
Normal file
BIN
static/assets/documents/original/Акт приема-передачи.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/original/Акт приема-сдачи.docx
Normal file
BIN
static/assets/documents/original/Акт приема-сдачи.docx
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
static/assets/documents/original/Лист согласования.docx
Normal file
BIN
static/assets/documents/original/Лист согласования.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/original/Спецификация.docx
Normal file
BIN
static/assets/documents/original/Спецификация.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/person/addition_act_1_person.docx
Normal file
BIN
static/assets/documents/person/addition_act_1_person.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/person/addition_act_2_person.docx
Normal file
BIN
static/assets/documents/person/addition_act_2_person.docx
Normal file
Binary file not shown.
Binary file not shown.
BIN
static/assets/documents/person/bill_person.docx
Normal file
BIN
static/assets/documents/person/bill_person.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/person/contract_postavki_person.docx
Normal file
BIN
static/assets/documents/person/contract_postavki_person.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/person/specification_person.docx
Normal file
BIN
static/assets/documents/person/specification_person.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/plc/addition_act_1_plc.docx
Normal file
BIN
static/assets/documents/plc/addition_act_1_plc.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/plc/addition_act_2_plc.docx
Normal file
BIN
static/assets/documents/plc/addition_act_2_plc.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/plc/addition_list_soglasovania_plc.docx
Normal file
BIN
static/assets/documents/plc/addition_list_soglasovania_plc.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/plc/bill_plc.docx
Normal file
BIN
static/assets/documents/plc/bill_plc.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/plc/contract_postavki_plc.docx
Normal file
BIN
static/assets/documents/plc/contract_postavki_plc.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/plc/specification_plc.docx
Normal file
BIN
static/assets/documents/plc/specification_plc.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/sp/addition_act_1_sp.docx
Normal file
BIN
static/assets/documents/sp/addition_act_1_sp.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/sp/addition_act_2_sp.docx
Normal file
BIN
static/assets/documents/sp/addition_act_2_sp.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/sp/addition_list_soglasovania_sp.docx
Normal file
BIN
static/assets/documents/sp/addition_list_soglasovania_sp.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/sp/bill_sp.docx
Normal file
BIN
static/assets/documents/sp/bill_sp.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/sp/contract_postavki_sp.docx
Normal file
BIN
static/assets/documents/sp/contract_postavki_sp.docx
Normal file
Binary file not shown.
BIN
static/assets/documents/sp/specification_sp.docx
Normal file
BIN
static/assets/documents/sp/specification_sp.docx
Normal file
Binary file not shown.
4
static/src/css/mimetypes.css
Normal file
4
static/src/css/mimetypes.css
Normal file
@ -0,0 +1,4 @@
|
||||
.o_image[data-mimetype$='msword'],
|
||||
.o_image[data-mimetype$='application/vnd.openxmlformats-officedocument.wordprocessingml.document'] {
|
||||
background-image: url('/client_contracts/static/src/img/msword.png');
|
||||
}
|
BIN
static/src/img/msword.png
Normal file
BIN
static/src/img/msword.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
@ -1 +1 @@
|
||||
MODULE_NAME = __package__.split('.')[-2]
|
||||
MODULE_NAME = __package__.split(".")[-2]
|
||||
|
28
utils/misc.py
Normal file
28
utils/misc.py
Normal file
@ -0,0 +1,28 @@
|
||||
import datetime as dt
|
||||
import inspect
|
||||
|
||||
from odoo import fields
|
||||
from odoo.tools.misc import (DEFAULT_SERVER_DATE_FORMAT,
|
||||
DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
|
||||
|
||||
class IDocument(object):
|
||||
"""Class must be used as an interface for create new document based model"""
|
||||
|
||||
def get_name_by_document_template(self, document_template_id: fields.Many2one):
|
||||
raise NotImplementedError(
|
||||
"Method {} is not implemented".format(inspect.currentframe().f_code.co_name)
|
||||
)
|
||||
|
||||
def get_filename_by_document_template(self, document_template_id: fields.Many2one):
|
||||
raise NotImplementedError(
|
||||
"Method {} is not implemented".format(inspect.currentframe().f_code.co_name)
|
||||
)
|
||||
|
||||
|
||||
class Extension(object):
|
||||
def parse_odoo_date(self, date: str):
|
||||
return dt.datetime.strptime(date, DEFAULT_SERVER_DATE_FORMAT)
|
||||
|
||||
def parse_odoo_datetime(self, datetime: str):
|
||||
return dt.datetime.strptime(datetime, DEFAULT_SERVER_DATETIME_FORMAT)
|
@ -3,27 +3,18 @@
|
||||
|
||||
<!-- res.partner.contract.field action window -->
|
||||
<record id="res_partner_contract_field_action" model="ir.actions.act_window">
|
||||
<field name="name">res.partner.contract.field.action</field>
|
||||
<field name="name">Contract Fields</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.partner.contract.field</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
<!-- res.partner.template.print.contract action window -->
|
||||
<record id="res_partner_print_contract_action" model="ir.actions.act_window">
|
||||
<field name="name">res.partner.template.print.contract.action</field>
|
||||
<!-- res.partner.document.template action window -->
|
||||
<record id="res_partner_document_template_action" model="ir.actions.act_window">
|
||||
<field name="name">Document Templates</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.partner.template.print.contract</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
<!-- res.partner.template.print.annex action window -->
|
||||
<record id="res_partner_print_annex_action" model="ir.actions.act_window">
|
||||
<field name="name">res.partner.template.print.annex.action</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.partner.template.print.annex</field>
|
||||
<field name="res_model">res.partner.document.template</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
@ -35,21 +26,34 @@
|
||||
<field name="priority" eval="25"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<xpath expr="//field[@name='name']" position="attributes">
|
||||
<attribute name="placeholder">Name in ERP</attribute>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//field[@name='type']" position="before">
|
||||
<field name="name" attrs="{'invisible': [('company_type', '=', 'company')]}"/>
|
||||
<field name="name_genitive" attrs="{'invisible': [('company_type', '=', 'company')]}"/>
|
||||
<field name="name_initials" attrs="{'invisible': [('company_type', '=', 'company')]}"/>
|
||||
<field name="name_write" placeholder="i.e. Ural Bank for Reconstruction and Development" attrs="{'invisible': [('is_company', '=', False)]}"/>
|
||||
<field name="name_genitive" attrs="{'invisible': [('is_company', '=', True)]}"/>
|
||||
<field name="name_initials" attrs="{'invisible': [('is_company', '=', True)]}"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//field[@name='function']" position="after">
|
||||
<field name="function_genitive" attrs="{'invisible': [('is_company', '=', True)]}"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//field[@name='category_id']" position="after">
|
||||
<field name="representative_id" domain="[('company_type', '=', 'person')]" attrs="{'invisible': [('company_type', '!=', 'company')]}"/>
|
||||
<field name="representative_document" attrs="{'invisible': [('company_type', '!=', 'company')]}"/>
|
||||
<field name="representative_id" domain="[('is_company', '=', False)]" attrs="{'invisible': [('is_company', '=', False)]}"/>
|
||||
<field name="representative_document" attrs="{'invisible': [('is_company', '=', False)]}"/>
|
||||
|
||||
<field name="signature" widget="image"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//field[@name='function']" position="after">
|
||||
<field name="function_genitive" attrs="{'invisible': [('is_company','=', True)]}"/>
|
||||
<field name="function_genitive" attrs="{'invisible': [('is_company','=', True)]}" invisible="1"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="//field[@name='email']" position="before">
|
||||
<field name="whatsapp" attrs="{'invisible': [('is_company', '=', True)]}"/>
|
||||
<field name="telegram" attrs="{'invisible': [('is_company', '=', True)]}"/>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
@ -86,18 +90,7 @@
|
||||
<menuitem id="res_partner_menu_contracts_templates"
|
||||
name="Templates"
|
||||
parent="res_partner_menu_contracts"
|
||||
sequence="2"/>
|
||||
|
||||
<menuitem id="res_partner_menu_contracts_templates_contract"
|
||||
name="Contract"
|
||||
parent="res_partner_menu_contracts_templates"
|
||||
action="res_partner_print_contract_action"
|
||||
sequence="1"/>
|
||||
|
||||
<menuitem id="res_partner_menu_contracts_templates_annex"
|
||||
name="Annex"
|
||||
parent="res_partner_menu_contracts_templates"
|
||||
action="res_partner_print_annex_action"
|
||||
action="res_partner_document_template_action"
|
||||
sequence="2"/>
|
||||
|
||||
</odoo>
|
||||
|
@ -8,8 +8,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Contracts">
|
||||
<field name="name"/>
|
||||
<field name="date_conclusion"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="date_conclusion"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@ -19,7 +20,7 @@
|
||||
<field name="name">Contract Form</field>
|
||||
<field name="model">res.partner.contract</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Contract">
|
||||
<form string="Contract" create="0">
|
||||
<header attrs="{'invisible': [('id', '=', False)]}">
|
||||
<button name="action_sign" type="object" string="Sign" states="draft" class="oe_highlight"/>
|
||||
<button name="action_close" type="object" string="Close" states="sign" class="oe_highlight"/>
|
||||
@ -40,9 +41,12 @@
|
||||
<!-- Uses to generate number of Annex -->
|
||||
<field name="contract_annex_number" invisible="1"/>
|
||||
</group>
|
||||
<group string="Annexed orders" name="annexes" attrs="{'invisible': [('id', '=', False)]}">
|
||||
<field name="contract_annex_ids">
|
||||
<field name="name"/>
|
||||
<group string="Annexed Specifications" name="annexes" attrs="{'invisible': [('id', '=', False)]}">
|
||||
<field name="contract_annex_ids" nolabel="1">
|
||||
<tree>
|
||||
<field name="display_name" string="Name"/>
|
||||
<button name="action_print_form" type="object" string="Print" attrs="{'invisible': [('id', '=', False)]}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</sheet>
|
||||
|
@ -10,16 +10,35 @@
|
||||
|
||||
<form string="Contract Annex">
|
||||
<sheet>
|
||||
<group>
|
||||
<group name="options" invisible="1">
|
||||
<field name="display_name" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</group>
|
||||
<group name="info" string="Info">
|
||||
<field name="name" placeholder="Leave empty for compute"/>
|
||||
<field name="contract_id" attrs="{'invisible': [('contract_id', '=', False)]}"/>
|
||||
<field name="order_id"/>
|
||||
<field name="order_id" options="{'no_create': True}"/>
|
||||
<field name="date_conclusion"/>
|
||||
<field name="payment_term" invisible="1"/>
|
||||
<field name="delivery_time" invisible="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<button name="action_print_form" type="object" string="Print" attrs="{'invisible': [('contract_id', '=', False)]}"/>
|
||||
<group name="design" string="Design">
|
||||
<field name="design_cost"/>
|
||||
<field name="design_doc_period"/>
|
||||
<field name="design_doc_cost"/>
|
||||
</group>
|
||||
<group name="delivery" string="Delivery">
|
||||
<field name="delivery_address"/>
|
||||
<field name="delivery_period"/>
|
||||
</group>
|
||||
<group name="installation" string="Installation">
|
||||
<field name="installation_address"/>
|
||||
<field name="installation_period"/>
|
||||
<field name="installation_cost"/>
|
||||
</group>
|
||||
<group name="payment" string="Payment">
|
||||
<field name="total_cost"/>
|
||||
<field name="payment_part_one" widget="integer"/>
|
||||
<field name="payment_part_two" widget="integer"/>
|
||||
<field name="payment_part_three" widget="integer"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
|
20
views/res_partner_contract_field.xml
Normal file
20
views/res_partner_contract_field.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- res.partner.contract.field tree view -->
|
||||
<record id="res_partner_contract_field_view_tree" model="ir.ui.view">
|
||||
<field name="name">res.partner.contract.field.view.tree</field>
|
||||
<field name="model">res.partner.contract.field</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="description"/>
|
||||
<field name="technical_name"/>
|
||||
<field name="visible"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
17
views/res_partner_document_template.xml
Normal file
17
views/res_partner_document_template.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<odoo>
|
||||
|
||||
<!-- res.partner.document.template tree view -->
|
||||
<record id="res_partner_document_template_view_tree" model="ir.ui.view">
|
||||
<field name="name">res.partner.document.template.view.tree</field>
|
||||
<field name="model">res.partner.document.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
<field name="company_type"/>
|
||||
<field name="document_type"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
@ -1,40 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- res.partner.template.print.contract form view -->
|
||||
<record id="res_partner_template_print_contract_view_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.template.print.contract.view.form</field>
|
||||
<field name="model">res.partner.template.print.contract</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Template Contract">
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="attachment_id"/>
|
||||
<field name="company_type"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- res.partner.template.print.annex form view -->
|
||||
<record id="res_partner_template_print_annex_view_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.template.print.annex.view.form</field>
|
||||
<field name="model">res.partner.template.print.annex</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Template Annex">
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="attachment_id"/>
|
||||
<field name="company_type"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
@ -1,22 +1,37 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import base64
|
||||
import logging
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
from odoo import api, fields, models
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
from ..utils import MODULE_NAME
|
||||
from ..utils.docxtpl import get_document_from_values_stream
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ContractWizard(models.TransientModel):
|
||||
_name = "res.partner.contract.wizard"
|
||||
|
||||
def _get_default_partner(self):
|
||||
current_id = self.env.context.get("active_id")
|
||||
return self.env["res.partner.contract"].browse(current_id).partner_id.id
|
||||
def _default_target(self):
|
||||
return "{model},{target_id}".format(
|
||||
model=self.active_model, target_id=int(self.env.context.get("self_id"))
|
||||
)
|
||||
|
||||
def _default_document_template(self):
|
||||
return self.env["res.partner.document.template"].search(self._get_template_domain(), limit=1)
|
||||
|
||||
def _get_template_domain(self):
|
||||
template_type = {
|
||||
"res.partner.contract": "contract",
|
||||
"res.partner.contract.annex": "annex",
|
||||
}.get(self.active_model, False)
|
||||
company_type = (
|
||||
self.partner_id.company_form if self.partner_id.is_company else "person"
|
||||
)
|
||||
|
||||
document_template_domain = [
|
||||
("template_type", "=", template_type),
|
||||
("company_type", "=", company_type),
|
||||
]
|
||||
return document_template_domain
|
||||
|
||||
target = fields.Reference(
|
||||
selection=[
|
||||
@ -24,24 +39,63 @@ class ContractWizard(models.TransientModel):
|
||||
("res.partner.contract.annex", "Contract Annex"),
|
||||
],
|
||||
string="Target",
|
||||
default=_default_target,
|
||||
)
|
||||
company_id = fields.Many2one("res.partner", string="Company")
|
||||
partner_id = fields.Many2one("res.partner", string="Partner")
|
||||
print_template_contract = fields.Many2one(
|
||||
"res.partner.template.print.contract", string="Print Template of Contract",
|
||||
company_id = fields.Many2one(
|
||||
"res.partner", string="Company", compute="_compute_company_id",
|
||||
)
|
||||
print_template_annex = fields.Many2one(
|
||||
"res.partner.template.print.annex", string="Print Template of Contract Annex",
|
||||
partner_id = fields.Many2one(
|
||||
"res.partner", string="Partner", compute="_compute_partner_id",
|
||||
)
|
||||
document_name = fields.Char(
|
||||
string="Document Name", compute="_compute_document_name"
|
||||
)
|
||||
document_template = fields.Many2one(
|
||||
"res.partner.document.template",
|
||||
string="Document Template",
|
||||
default=_default_document_template,
|
||||
readonly=False,
|
||||
)
|
||||
|
||||
transient_field_ids = fields.One2many(
|
||||
"res.partner.contract.field.transient",
|
||||
"_contract_wizard_id",
|
||||
string="Contract Fields",
|
||||
)
|
||||
transient_field_ids_hidden = fields.One2many(
|
||||
"res.partner.contract.field.transient", "_contract_wizard_id",
|
||||
)
|
||||
|
||||
@api.onchange("target")
|
||||
def _onchange_target(self):
|
||||
@api.depends("company_id", "target")
|
||||
def _compute_company_id(self):
|
||||
if self.target:
|
||||
self.company_id = self.target.company_id
|
||||
|
||||
@api.depends("partner_id", "target")
|
||||
def _compute_partner_id(self):
|
||||
if self.target:
|
||||
self.partner_id = self.target.partner_id
|
||||
|
||||
@api.depends("document_name", "document_template", "target")
|
||||
def _compute_document_name(self):
|
||||
self.document_name = self.target.get_name_by_document_template(
|
||||
self.document_template
|
||||
)
|
||||
|
||||
@api.constrains("document_template")
|
||||
def _check_document_template(self):
|
||||
if not self.document_template:
|
||||
raise ValidationError("You did not set up the template...")
|
||||
|
||||
@api.onchange('document_template')
|
||||
def _domain_document_template(self):
|
||||
return {
|
||||
"domain": {
|
||||
"document_template": self._get_template_domain(),
|
||||
}
|
||||
}
|
||||
|
||||
@api.onchange("document_template")
|
||||
def _onchange_document_template(self):
|
||||
"""Creates transient fields for generate contract template
|
||||
Looks as a tree view of *_contract_field_transient model in xml
|
||||
"""
|
||||
@ -51,36 +105,11 @@ class ContractWizard(models.TransientModel):
|
||||
[("technical_name", "=", technical_name),]
|
||||
)
|
||||
|
||||
# A model is the wizard called from
|
||||
active_model = self.env.context.get("active_model")
|
||||
# A record is the model called from (manually set with context)
|
||||
target_id = self.env.context.get("self_id")
|
||||
|
||||
# Reference to this record
|
||||
self.target = "{model},{record_id}".format(
|
||||
model=active_model, record_id=int(target_id)
|
||||
)
|
||||
|
||||
# Check for model and get this meta fields
|
||||
company_id = (
|
||||
self.target.company_id
|
||||
if hasattr(self.target, "company_id")
|
||||
else self.target.contract_id.company_id
|
||||
)
|
||||
partner_id = (
|
||||
self.target.partner_id
|
||||
if hasattr(self.target, "partner_id")
|
||||
else self.target.contract_id.partner_id
|
||||
)
|
||||
|
||||
self.company_id = company_id
|
||||
self.partner_id = partner_id
|
||||
|
||||
model_to_action = {
|
||||
"res.partner.contract": "{}.action_get_contract_context".format(MODULE_NAME),
|
||||
"res.partner.contract.annex": "{}.action_get_annex_context".format(MODULE_NAME),
|
||||
"res.partner.contract": "action_get_contract_context",
|
||||
"res.partner.contract.annex": "action_get_annex_context",
|
||||
}
|
||||
action = model_to_action[active_model]
|
||||
action = "{}.{}".format(MODULE_NAME, model_to_action[self.active_model])
|
||||
|
||||
# Get dictionary for `transient_fields_ids` with editable fields
|
||||
# With data from Odoo database
|
||||
@ -98,50 +127,33 @@ class ContractWizard(models.TransientModel):
|
||||
.id,
|
||||
0,
|
||||
)
|
||||
for field, value in sorted(contract_context_values.items(), key=lambda tpl: self.env.ref("{}.contract_field_{}".format(MODULE_NAME, tpl[0])).sequence)
|
||||
for field, value in sorted(
|
||||
contract_context_values.items(),
|
||||
key=lambda tpl: self.env.ref(
|
||||
"{}.contract_field_{}".format(MODULE_NAME, tpl[0])
|
||||
).sequence,
|
||||
)
|
||||
]
|
||||
|
||||
# Set up template domain
|
||||
company_type = (
|
||||
self.partner_id.company_form if self.partner_id.is_company else "person"
|
||||
self.transient_field_ids_hidden = (
|
||||
self.transient_field_ids - self.transient_field_ids.filtered("visible")
|
||||
)
|
||||
return {
|
||||
"domain": {
|
||||
"print_template_contract": [("company_type", "=", company_type)],
|
||||
"print_template_annex": [("company_type", "=", company_type)],
|
||||
}
|
||||
}
|
||||
self.transient_field_ids = (
|
||||
self.transient_field_ids - self.transient_field_ids_hidden
|
||||
)
|
||||
|
||||
# Other
|
||||
|
||||
@api.multi
|
||||
def get_docx_contract(self):
|
||||
template = self._get_template()
|
||||
if not template:
|
||||
raise UserError("Template must be set up")
|
||||
template = self.document_template.attachment_id
|
||||
template_path = template._full_path(template.store_fname)
|
||||
|
||||
path_to_template = template._full_path(template.store_fname)
|
||||
|
||||
fields = {
|
||||
transient_field.technical_name: transient_field.value
|
||||
for transient_field in self.transient_field_ids
|
||||
if transient_field.technical_name and transient_field.value
|
||||
}
|
||||
|
||||
binary_data = get_document_from_values_stream(path_to_template, fields).read()
|
||||
payload = self.payload()
|
||||
binary_data = get_document_from_values_stream(template_path, payload).read()
|
||||
encoded_data = base64.b64encode(binary_data)
|
||||
|
||||
attachment_name = "{name}-{number}.{ext}".format(
|
||||
number=self.target.name,
|
||||
ext="docx",
|
||||
name=(
|
||||
_("Contract")
|
||||
if self.target._name == "res.partner.contract"
|
||||
else (
|
||||
_("Annex")
|
||||
if self.target._name == "res.partner.contract.annex"
|
||||
else ("Unknown")
|
||||
)
|
||||
),
|
||||
)
|
||||
get_fn = self.target.get_filename_by_document_template
|
||||
attachment_name = "{}.docx".format(get_fn(self.document_template or "Unknown"))
|
||||
|
||||
document_as_attachment = self.env["ir.attachment"].create(
|
||||
{
|
||||
@ -152,7 +164,51 @@ class ContractWizard(models.TransientModel):
|
||||
}
|
||||
)
|
||||
|
||||
# Send message with attachment to a mail.thread of the company
|
||||
return self.afterload(document_as_attachment)
|
||||
|
||||
def payload(self):
|
||||
# Collect fields into a key-value structure
|
||||
fields = {
|
||||
transient_field.technical_name: transient_field.value
|
||||
for transient_field in (
|
||||
self.transient_field_ids + self.transient_field_ids_hidden
|
||||
)
|
||||
if transient_field.technical_name and transient_field.value
|
||||
}
|
||||
# Extend with special case
|
||||
if self.target._name == "res.partner.contract.annex":
|
||||
fields.update(
|
||||
{
|
||||
"annex_name": self.document_name,
|
||||
"specification_name": self.target.specification_name,
|
||||
}
|
||||
)
|
||||
# Extend with order product lines
|
||||
if hasattr(self.target, "order_id") and self.target.order_id.order_line:
|
||||
def number_generator(n=1):
|
||||
while (True):
|
||||
yield n
|
||||
n += 1
|
||||
|
||||
counter = number_generator()
|
||||
|
||||
fields.update(
|
||||
{
|
||||
"order_products": [
|
||||
{
|
||||
"number": next(counter),
|
||||
"label": item.product_id.name,
|
||||
"count": item.product_uom_qty,
|
||||
"unit": item.product_uom.name,
|
||||
"cost": item.price_unit,
|
||||
"amount": item.price_subtotal,
|
||||
} for item in self.target.order_id.order_line or []
|
||||
]
|
||||
}
|
||||
)
|
||||
return fields
|
||||
|
||||
def afterload(self, result):
|
||||
res_id = self.target.id
|
||||
if hasattr(self.target, "contract_id"):
|
||||
res_id = self.target.contract_id.id
|
||||
@ -162,16 +218,12 @@ class ContractWizard(models.TransientModel):
|
||||
"model": "res.partner.contract",
|
||||
"res_id": res_id,
|
||||
"message_type": "comment",
|
||||
"attachment_ids": [(4, document_as_attachment.id, False)],
|
||||
"attachment_ids": [(4, result.id, False)],
|
||||
}
|
||||
)
|
||||
|
||||
return document_as_attachment
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
def _get_template(self):
|
||||
model_to_template = {
|
||||
"res.partner.contract": self.print_template_contract.attachment_id,
|
||||
"res.partner.contract.annex": self.print_template_annex.attachment_id,
|
||||
}
|
||||
return model_to_template.get(self.env.context.get("active_model"), False)
|
||||
@property
|
||||
def active_model(self):
|
||||
return self.env.context.get("active_model")
|
||||
|
@ -1,23 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="res_partner_wizard_print_contract_view" model="ir.ui.view">
|
||||
<field name="name">Print Contract</field>
|
||||
<record id="res_partner_wizard_print_document_view" model="ir.ui.view">
|
||||
<field name="name">Generate Document</field>
|
||||
<field name="model">res.partner.contract.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<form>
|
||||
|
||||
<group string="Template">
|
||||
<field name="print_template_contract"></field>
|
||||
<field name="document_template"></field>
|
||||
</group>
|
||||
<group name="requisites" string="Requisites">
|
||||
|
||||
<group invisible="1">
|
||||
<!-- Need for generate a document -->
|
||||
<field name="target"/>
|
||||
<field name="partner_id" string="Partner" readonly="1"/>
|
||||
<field name="company_id" string="Seller" readonly="1"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="company_id"/>
|
||||
</group>
|
||||
<group string="Contract values" colspan="4">
|
||||
<field name="transient_field_ids">
|
||||
|
||||
<button string="Create a document" type="object" name="get_docx_contract" />
|
||||
|
||||
<group string="Values">
|
||||
<field name="transient_field_ids" nolabel="1" colspan="4">
|
||||
<tree editable="1" create="0" delete="0">
|
||||
<field name="name"/>
|
||||
<field name="value"/>
|
||||
@ -25,42 +30,9 @@
|
||||
<field name="technical_name" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
<field name="transient_field_ids_hidden" invisible="1"/>
|
||||
</group>
|
||||
|
||||
<button string="Create a document" type="object" name="get_docx_contract" />
|
||||
|
||||
<footer/>
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="res_partner_wizard_print_annex_view" model="ir.ui.view">
|
||||
<field name="name">Print Annex</field>
|
||||
<field name="model">res.partner.contract.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<form>
|
||||
|
||||
<group string="Template">
|
||||
<field name="print_template_annex"></field>
|
||||
</group>
|
||||
<group name="info" string="Info">
|
||||
<field name="target"/>
|
||||
</group>
|
||||
<group string="Annex values" colspan="4">
|
||||
<field name="transient_field_ids">
|
||||
<tree editable="1" create="0" delete="0">
|
||||
<field name="name"/>
|
||||
<field name="value"/>
|
||||
<field name="description" invisible="1"/>
|
||||
<field name="technical_name" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
|
||||
<button string="Create a document" type="object" name="get_docx_contract" />
|
||||
|
||||
<footer/>
|
||||
|
||||
</form>
|
||||
|
Loading…
x
Reference in New Issue
Block a user