[MIG] stock_picking_comment_template: Migration to 14.0

This commit is contained in:
Alfredo Zamora
2021-05-31 12:58:20 +02:00
parent 8b855e6d02
commit fd006d845a
16 changed files with 113 additions and 163 deletions

View File

@@ -1,10 +1,25 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.actions.act_window" id="action_stock_picking_comment_template">
<field name="name">Stock Picking Comment Templates</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">base.comment.template</field>
<field name="view_mode">tree,form</field>
<field
name="domain"
eval="[('model_ids', 'in', [ref('stock.model_stock_picking')])]"
/>
<field
name="view_id"
ref="base_comment_template.view_base_comment_template_tree"
/>
</record>
<menuitem
name="Document Comments"
id="menu_base_comment_template_picking"
action="base_comment_template.action_base_comment_template"
action="stock_picking_comment_template.action_stock_picking_comment_template"
parent="stock.menu_stock_config_settings"
/>

View File

@@ -5,16 +5,22 @@
id="report_delivery_document_comments"
inherit_id="stock.report_delivery_document"
>
<xpath expr="//table[hasclass('table-sm')]" position="before">
<p t-if="o.note1">
<span t-field="o.note1" />
</p>
</xpath>
<xpath expr="(//p)[position()=last()]" position="after">
<p t-if="o.note2">
<span t-field="o.note2" />
</p>
</xpath>
<xpath expr="//table[hasclass('table-sm')]" position="before">
<t
t-foreach="o.comment_template_ids.filtered(lambda x: x.position == 'before_lines')"
t-as="comment_template_top"
>
<div t-raw="comment_template_top.text" />
</t>
</xpath>
<xpath expr="//div[hasclass('page')]" position="inside">
<t
t-foreach="o.comment_template_ids.filtered(lambda x: x.position == 'after_lines')"
t-as="comment_template_bottom"
>
<div t-raw="comment_template_bottom.text" />
</t>
</xpath>
</template>
</odoo>

View File

@@ -2,16 +2,22 @@
<odoo>
<template id="report_picking_document_comments" inherit_id="stock.report_picking">
<xpath expr="//table[hasclass('table-sm')]" position="before">
<p t-if="o.note1">
<span t-field="o.note1" />
</p>
</xpath>
<xpath expr="//p[@t-field='o.note']" position="after">
<p t-if="o.note2">
<span t-field="o.note2" />
</p>
</xpath>
<xpath expr="//table[hasclass('table-sm')]" position="before">
<t
t-foreach="o.comment_template_ids.filtered(lambda x: x.position == 'before_lines')"
t-as="comment_template_top"
>
<div t-raw="comment_template_top.text" />
</t>
</xpath>
<xpath expr="//p[@t-field='o.note']" position="after">
<t
t-foreach="o.comment_template_ids.filtered(lambda x: x.position == 'after_lines')"
t-as="comment_template_bottom"
>
<div t-raw="comment_template_bottom.text" />
</t>
</xpath>
</template>
</odoo>

View File

@@ -1,34 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.ui.view" id="stock_picking_form_add_comment">
<field name="name">stock.picking.form.comment</field>
<field name="name">comment_template.stock.picking.form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page string="Comments" name="comments">
<p
style="margin-top: 10px;"
>The comments will be displayed on the printed document. You can load a predefined template, write your own text or load a template and then modify it only for this document.</p>
<group string="Top Comments">
<field
name="comment_template1_id"
string="Load a template"
domain="[('position','=','before_lines')]"
context="{'default_position': 'before_lines'}"
/>
<field name="note1" nolabel="1" colspan="2" />
</group>
<group string="Bottom Comments">
<field
name="comment_template2_id"
string="Load a template"
context="{'default_position': 'after_lines'}"
domain="[('position','=','after_lines')]"
/>
<field name="note2" nolabel="1" colspan="2" />
</group>
</page>
<page string="Comments" name="comments">
<field name="comment_template_ids" />
</page>
</xpath>
</field>
</record>