[REF] sale, sale_stock: dates

Remove the "sale.group_sale_order_dates" group and settings, all the date
fields are always displayed but we put schedule_date and commitment_date
(for which the label was renamed "delivery date") on the same line (with
a design to make the schedule date looks like a suggestion for the
delivery date).

task 2057802

closes odoo/odoo#37174

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
Simon Lejeune
2019-09-20 07:02:22 +00:00
parent 543a5523a3
commit d5111aec9f
7 changed files with 16 additions and 32 deletions
@@ -17,7 +17,6 @@ class ResConfigSettings(models.TransientModel):
group_sale_delivery_address = fields.Boolean("Customer Addresses", implied_group='sale.group_delivery_invoice_address')
group_proforma_sales = fields.Boolean(string="Pro-Forma Invoice", implied_group='sale.group_proforma_sales',
help="Allows you to send pro-forma invoice.")
group_sale_order_dates = fields.Boolean("Delivery Date", implied_group='sale.group_sale_order_dates')
default_invoice_policy = fields.Selection([
('order', 'Invoice what is ordered'),
('delivery', 'Invoice what is delivered')
+3 -3
View File
@@ -179,7 +179,7 @@ class SaleOrder(models.Model):
signed_by = fields.Char('Signed By', help='Name of the person that signed the SO.', copy=False)
signed_on = fields.Datetime('Signed On', help='Date of the signature.', copy=False)
commitment_date = fields.Datetime('Commitment Date',
commitment_date = fields.Datetime('Delivery Date',
states={'draft': [('readonly', False)], 'sent': [('readonly', False)]},
copy=False, readonly=True,
help="This is the delivery date promised to the customer. "
@@ -367,8 +367,8 @@ class SaleOrder(models.Model):
return {
'warning': {
'title': _('Requested date is too soon.'),
'message': _("The commitment date is sooner than the expected date."
"You may be unable to honor the commitment date.")
'message': _("The delivery date is sooner than the expected date."
"You may be unable to honor the delivery date.")
}
}
-6
View File
@@ -21,12 +21,6 @@
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_sale_order_dates" model="res.groups">
<field name="name">Manage delivery dates from sales orders.</field>
<field name="category_id" ref="base.module_category_hidden"/>
<field name="comment">This option introduces extra fields in the sales order to easily schedule product deliveries on your own: expected date, commitment date, effective date.</field>
</record>
<record model="res.users" id="base.user_root">
<field eval="[(4,ref('base.group_partner_manager'))]" name="groups_id"/>
</record>
@@ -273,17 +273,6 @@
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" title="This option introduces extra fields in the sales order to easily schedule product deliveries on your own: expected date, commitment date, effective date." id="sale_order_dates">
<div class="o_setting_left_pane">
<field name="group_sale_order_dates"/>
</div>
<div class="o_setting_right_pane">
<label for="group_sale_order_dates"/>
<div class="text-muted">
Manage delivery dates from sales orders
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="ups">
<div class="o_setting_left_pane">
<field name="module_delivery_ups" widget="upgrade_boolean"/>
+9 -7
View File
@@ -190,8 +190,8 @@
<field name="message_needaction" invisible="1"/>
<field name="name" string="Order Number"/>
<field name="date_order" string="Order Date"/>
<field name="commitment_date" groups="sale.group_sale_order_dates"/>
<field name="expected_date" groups="sale.group_sale_order_dates"/>
<field name="commitment_date"/>
<field name="expected_date"/>
<field name="partner_id"/>
<field name="user_id" optional="show"/>
<field name="team_id" optional="hide"/>
@@ -216,8 +216,8 @@
<field name="message_needaction" invisible="1"/>
<field name="name" string="Quotation Number"/>
<field name="create_date" string="Create Date"/>
<field name="commitment_date" groups="sale.group_sale_order_dates"/>
<field name="expected_date" groups="sale.group_sale_order_dates"/>
<field name="commitment_date"/>
<field name="expected_date"/>
<field name="partner_id"/>
<field name="user_id" optional="show"/>
<field name="team_id" optional="hide"/>
@@ -641,9 +641,11 @@
</group>
</group>
<group>
<group name="sale_shipping" groups="sale.group_sale_order_dates">
<field name="expected_date"/>
<field name="commitment_date"/>
<group name="sale_shipping">
<label for="commitment_date" string="Delivery Date"/>
<div class="o_row">
<field name="commitment_date"/> <span class="text-muted">Expected: <field name="expected_date" widget="date"/></span>
</div>
</group>
<group string="Reporting" name="sale_reporting" groups="base.group_no_one">
<group name="technical" colspan="2" class="mb-0">
@@ -6,7 +6,7 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="sale.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='sale_order_dates']" position="after">
<xpath expr="//div[@id='ups']" position="after">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="group_display_incoterm"/>
+3 -3
View File
@@ -20,13 +20,13 @@
<attribute name="groups"></attribute><!-- Remove the res.group on the group and set it on the field directly-->
<attribute name="string">Delivery</attribute>
</xpath>
<xpath expr="//field[@name='expected_date']" position="before">
<xpath expr="//label[@for='commitment_date']" position="before">
<field name="warehouse_id" options="{'no_create': True}" groups="stock.group_stock_multi_warehouses" force_save="1"/>
<field name="incoterm" widget="selection" groups="sale_stock.group_display_incoterm"/>
<field name="picking_policy" required="True"/>
</xpath>
<xpath expr="//field[@name='commitment_date']" position="after">
<field name="effective_date" groups="sale.group_sale_order_dates"/>
<xpath expr="//group[@name='sale_shipping']" position="inside">
<field name="effective_date"/>
</xpath>
<xpath expr="//page/field[@name='order_line']/form/group/group/field[@name='price_unit']" position="before">
<field name="product_packaging" attrs="{'invisible': [('product_id', '=', False)]}" context="{'default_product_id': product_id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}" domain="[('product_id','=',product_id)]" groups="product.group_stock_packaging" />