[MOV] sale_management -> sale: invoice creation from sale_order.

Enable invoice management from sale order in all modules having sale as dependency.

closes odoo/odoo#35658

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
This commit is contained in:
Victor Feyens
2019-08-12 10:07:39 +00:00
parent c396d806a5
commit 8fd2455742
4 changed files with 28 additions and 35 deletions
+1
View File
@@ -33,6 +33,7 @@ This module contains all the common features of Sales Management and eCommerce.
'views/res_config_settings_views.xml',
'views/payment_views.xml',
'views/product_attribute_views.xml',
'views/product_views.xml',
'views/utm_campaign_views.xml'
],
'demo': [
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record model="ir.ui.view" id="product_template_sale_form_view">
<field name="name">product.template.sales</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='sale']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
<xpath expr="//group[@name='invoicing']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
</field>
</record>
</odoo>
+10 -2
View File
@@ -254,8 +254,16 @@
string="Void Transaction"
confirm="Are you sure you want to void the authorized transaction? This action can't be undone."
attrs="{'invisible': [('authorized_transaction_ids', '=', [])]}"/>
<button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" class="btn-primary"
attrs="{'invisible': [('invoice_status', '!=', 'to invoice')]}"/>
<button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" context="{'default_advance_payment_method': 'percentage'}"
attrs="{'invisible': ['|',('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>
<button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="btn-primary"/>
<button name="action_quotation_send" type="object" string="Send PRO-FORMA Invoice" groups="sale.group_proforma_sales" class="btn-primary" attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('invoice_count','&gt;=',1)]}" context="{'proforma': True}"/>
<button name="action_quotation_send" type="object" string="Send PRO-FORMA Invoice"
groups="sale.group_proforma_sales" class="btn-primary"
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('invoice_count','&gt;=',1)]}" context="{'proforma': True}"/>
<button name="action_confirm" id="action_confirm"
string="Confirm" class="btn-primary" type="object"
attrs="{'invisible': [('state', 'not in', ['sent'])]}"/>
@@ -625,7 +633,7 @@
<group name="sale_info" string="Invoicing">
<field name="fiscal_position_id" options="{'no_create': True}"/>
<field name="analytic_account_id" context="{'default_partner_id':partner_invoice_id, 'default_name':name}" attrs="{'readonly': [('invoice_count','!=',0),('state','=','sale')]}" groups="analytic.group_analytic_accounting" force_save="1"/>
<field name="invoice_status" states="sale,done" invisible="1"/>
<field name="invoice_status" states="sale,done"/>
</group>
</group>
<group>
@@ -52,25 +52,6 @@
<field name="active" eval="True"/>
</record>
<record id="sale_order_view_form" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='sale_info']/field[@name='invoice_status']" position="attributes">
<attribute name="invisible" eval="False"/>
</xpath>
<xpath expr="//button[@name='action_quotation_send']" position="before">
<button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" class="btn-primary"
attrs="{'invisible': [('invoice_status', '!=', 'to invoice')]}"/>
<button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" context="{'default_advance_payment_method': 'percentage'}"
attrs="{'invisible': ['|',('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>
</xpath>
</field>
</record>
<record id="res_config_settings_view_form_inherit_sale_management" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.sale.management</field>
<field name="model">res.config.settings</field>
@@ -82,18 +63,4 @@
</field>
</record>
<record model="ir.ui.view" id="product_template_sale_form_view">
<field name="name">product.template.sales</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='sale']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
<xpath expr="//group[@name='invoicing']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
</field>
</record>
</odoo>