Browse Source

[REF] Contract Sale: split from analytic account

[REF] Contract Sale: update translations
pull/207/head
Thomas Binsfeld 6 years ago
committed by sbejaoui
parent
commit
24f57be03d
  1. 4
      contract_sale/__manifest__.py
  2. 2
      contract_sale/i18n/contract_sale.pot
  3. 3
      contract_sale/i18n/gl.po
  4. 32
      contract_sale/migrations/12.0.2.0.0/pre-migration.py
  5. 8
      contract_sale/security/contract_security.xml
  6. 14
      contract_sale/security/ir.model.access.csv
  7. 18
      contract_sale/views/abstract_contract_line.xml
  8. 2
      contract_sale/views/contract.xml
  9. 18
      contract_sale/views/contract_line.xml
  10. 20
      contract_sale/views/contract_template.xml

4
contract_sale/__manifest__.py

@ -3,7 +3,7 @@
{
'name': 'Contract from Sale',
'version': '12.0.1.0.0',
'version': '12.0.2.0.0',
'category': 'Sales',
'author': 'Tecnativa, '
'Odoo Community Association (OCA)',
@ -14,7 +14,7 @@
],
'data': [
'security/ir.model.access.csv',
'security/account_analytic_account_security.xml',
'security/contract_security.xml',
'views/abstract_contract_line.xml',
'views/contract.xml',
'views/contract_line.xml',

2
contract_sale/i18n/contract_sale.pot

@ -6,6 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-29 10:00+0000\n"
"PO-Revision-Date: 2019-05-29 10:00+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"

3
contract_sale/i18n/gl.po

@ -1,11 +1,12 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_sale
# * contract_sale
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-05-29 10:00+0000\n"
"PO-Revision-Date: 2019-02-04 18:50+0000\n"
"Last-Translator: Marta Vázquez Rodríguez <vazrodmar@gmail.com>\n"
"Language-Team: none\n"

32
contract_sale/migrations/12.0.2.0.0/pre-migration.py

@ -0,0 +1,32 @@
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from openupgradelib import openupgrade
_logger = logging.getLogger(__name__)
def migrate(cr, version):
xmlids_to_rename = [
('contract_sale.account_analytic_account_own_salesman',
'contract_sale.contract_contract_own_salesman'),
('contract_sale.account_analytic_account_see_all',
'contract_sale.contract_contract_see_all'),
('contract_sale.account_analytic_contract_salesman',
'contract_sale.contract_template_salesman'),
('contract_sale.account_analytic_contract_sale_manager',
'contract_sale.contract_template_sale_manager'),
('contract_sale.account_analytic_invoice_line_saleman',
'contract_sale.contract_line_saleman'),
('contract_sale.account_analytic_invoice_line_manager',
'contract_sale.contract_line_manager'),
('contract_sale.account_analytic_contract_line_salesman',
'contract_sale.contract_template_line_salesman'),
('contract_sale.account_analytic_contract_line_manager',
'contract_sale.contract_template_line_manager'),
('contract_sale.account_analytic_account_contract_salesman',
'contract_sale.contract_contract_salesman'),
]
openupgrade.rename_xmlids(cr, xmlids_to_rename)

8
contract_sale/security/account_analytic_account_security.xml → contract_sale/security/contract_security.xml

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
<record id="account_analytic_account_own_salesman" model="ir.rule">
<record id="contract_contract_own_salesman" model="ir.rule">
<field name="name">See Own Contracts</field>
<field name="model_id" ref="analytic.model_account_analytic_account"/>
<field name="model_id" ref="contract.model_contract_contract"/>
<field name="domain_force">['|', ('user_id','=',user.id), ('user_id','=',False)]</field>
<field name="groups" eval="[(4,ref('sales_team.group_sale_salesman'))]"/>
</record>
<record id="account_analytic_account_see_all" model="ir.rule">
<record id="contract_contract_see_all" model="ir.rule">
<field name="name">See All Contracts</field>
<field name="model_id" ref="analytic.model_account_analytic_account"/>
<field name="model_id" ref="contract.model_contract_contract"/>
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[
(4,ref('sales_team.group_sale_salesman_all_leads')),

14
contract_sale/security/ir.model.access.csv

@ -1,12 +1,12 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"account_analytic_contract_salesman","Recurring Salesman","contract.model_account_analytic_contract","sales_team.group_sale_salesman",1,1,1,0
"account_analytic_contract_sale_manager","Recurring Sale Manager","contract.model_account_analytic_contract","sales_team.group_sale_manager",1,1,1,1
"account_analytic_invoice_line_saleman","Recurring Invoice Line Saleman","contract.model_account_analytic_invoice_line","sales_team.group_sale_salesman",1,1,1,0
"account_analytic_invoice_line_manager","Recurring Invoice Line Manager","contract.model_account_analytic_invoice_line","sales_team.group_sale_manager",1,1,1,1
"account_analytic_contract_line_salesman","Recurring Contract Line Salesman","contract.model_account_analytic_contract_line","sales_team.group_sale_salesman",1,1,1,0
"account_analytic_contract_line_manager","Recurring Contract Line Manager","contract.model_account_analytic_contract_line","sales_team.group_sale_manager",1,1,1,1
"contract_template_salesman","Recurring Salesman","contract.model_contract_template","sales_team.group_sale_salesman",1,1,1,0
"contract_template_sale_manager","Recurring Sale Manager","contract.model_contract_template","sales_team.group_sale_manager",1,1,1,1
"contract_line_saleman","Recurring Invoice Line Saleman","contract.model_contract_line","sales_team.group_sale_salesman",1,1,1,0
"contract_line_manager","Recurring Invoice Line Manager","contract.model_contract_line","sales_team.group_sale_manager",1,1,1,1
"contract_template_line_salesman","Recurring Contract Line Salesman","contract.model_contract_template_line","sales_team.group_sale_salesman",1,1,1,0
"contract_template_line_manager","Recurring Contract Line Manager","contract.model_contract_template_line","sales_team.group_sale_manager",1,1,1,1
"account_analytic_line_contract_salesman","Recurring Analytic Line Salesman","analytic.model_account_analytic_line","sales_team.group_sale_salesman",1,1,1,0
"account_analytic_account_contract_salesman","Recurring Analytic Account Salesman","analytic.model_account_analytic_account","sales_team.group_sale_salesman",1,1,1,0
"contract_contract_salesman","Recurring Analytic Account Salesman","contract.model_contract_contract","sales_team.group_sale_salesman",1,1,1,0
"account_analytic_tag_contract_salesman","Recurring Account Analytic Tag Salesman","analytic.model_account_analytic_tag","sales_team.group_sale_salesman",1,1,1,0
"account_invoice_contract_salesman","Recurring Account Inoice Salesman","account.model_account_invoice","sales_team.group_sale_salesman",1,0,0,0
"account_journal_contract_salesman","Recurring Account Journal Salesman","account.model_account_journal","sales_team.group_sale_salesman",1,0,0,0

18
contract_sale/views/abstract_contract_line.xml

@ -1,17 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="account_abstract_analytic_contract_line_view_form"
model="ir.ui.view">
<field name="name">account.abstract.analytic.contract.line.form (in contract_sale)</field>
<field name="model">account.abstract.analytic.contract.line</field>
<field name="inherit_id"
ref="contract.account_abstract_analytic_contract_line_view_form"/>
<!--FORM view-->
<record id="contract_abstract_contract_line_form_view" model="ir.ui.view">
<field name="name">contract.abstract.contract.line form view (in contract_sale)</field>
<field name="model">contract.abstract.contract.line</field>
<field name="inherit_id" ref="contract.contract_abstract_contract_line_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='discount']" position="attributes">
<attribute name="groups">sale.group_discount_per_so_line
</attribute>
</xpath>
<field name="discount" position="attributes">
<attribute name="groups">sale.group_discount_per_so_line</attribute>
</field>
</field>
</record>

2
contract_sale/views/contract.xml

@ -4,7 +4,7 @@
<menuitem
id="menu_contract_sale" name="Contracts"
parent="sale.sale_order_menu"
action="contract.action_account_analytic_sale_overdue_all"
action="contract.action_supplier_contract"
sequence="2"
groups="sales_team.group_sale_salesman"
/>

18
contract_sale/views/contract_line.xml

@ -1,17 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="account_analytic_invoice_line_view_tree"
model="ir.ui.view">
<field name="name">account.analytic.invoice.line.tree (in contract_sale)</field>
<field name="model">account.analytic.invoice.line</field>
<field name="inherit_id"
ref="contract.account_analytic_invoice_line_view_tree"/>
<!--TREE view-->
<record id="contract_line_tree_view" model="ir.ui.view">
<field name="name">contract.template.line tree view (in contract_sale)</field>
<field name="model">contract.line</field>
<field name="inherit_id" ref="contract.contract_line_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='discount']" position="attributes">
<attribute name="groups">sale.group_discount_per_so_line
</attribute>
</xpath>
<field name="discount" position="attributes">
<attribute name="groups">sale.group_discount_per_so_line</attribute>
</field>
</field>
</record>

20
contract_sale/views/contract_template.xml

@ -1,19 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="account_analytic_contract_view_form" model="ir.ui.view">
<field name="name">Account Analytic Contract Form View (in
sale_contract)
</field>
<field name="model">account.analytic.contract</field>
<field name="inherit_id"
ref="contract.account_analytic_contract_view_form"/>
<!--FORM view-->
<record id="contract_template_form_view" model="ir.ui.view">
<field name="name">contract.template form view (in contract_sale)</field>
<field name="model">contract.template</field>
<field name="inherit_id" ref="contract.contract_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='discount']" position="attributes">
<attribute name="groups">sale.group_discount_per_so_line
</attribute>
</xpath>
<field name="discount" position="attributes">
<attribute name="groups">sale.group_discount_per_so_line</attribute>
</field>
</field>
</record>

Loading…
Cancel
Save