Skip to content

Commit

Permalink
[ADD]stock_ux: origin description on delivery slip
Browse files Browse the repository at this point in the history
Add optional print of origin description insted of
product name in Delivery Slip report on transfers.
  • Loading branch information
PabloPaezSheridan committed Apr 28, 2021
1 parent 32de1b7 commit 8556337
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions stock_ux/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Several improvements to stock:
#. Change name to the menus Product Move and Product Move lines.
#. Add to "To Do" filter in stock move the state "partially_available".
#. Add optional constraints configurable by Picking Type:
#. Add optional print of origin description insted of product name in Delivery Slip report on transfers.

* Block Picking Edit: Restrict to add lines or to send more quantity than the original quantity. This will only apply to users with group Restrict Edit Blocked Pickings.

Expand Down
2 changes: 1 addition & 1 deletion stock_ux/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Stock UX',
'version': '13.0.1.5.0',
'version': '13.0.1.8.0',
'category': 'Warehouse Management',
'sequence': 14,
'summary': '',
Expand Down
14 changes: 14 additions & 0 deletions stock_ux/views/report_deliveryslip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
<span t-field="o.observations"/>
</p>
</table>
<xpath expr="//table[@name='stock_move_table']/tbody/tr/td[1]" position="replace">
<td t-if="o.env['ir.config_parameter'].sudo().get_param('stock_ux.delivery_slip_use_origin', 'False') == 'False'">
<span t-field="move.product_id"/>
<p t-if="move.description_picking != move.product_id.name">
<span t-field="move.description_picking"/>
</p>
</td>
<td t-if="o.env['ir.config_parameter'].sudo().get_param('stock_ux.delivery_slip_use_origin') == 'True'">
<span t-field="move.name"/>
<p>
<span t-field="move.description_picking"/>
</p>
</td>
</xpath>
</template>

</odoo>
15 changes: 15 additions & 0 deletions stock_ux/wizards/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,18 @@ class ResConfigSettings(models.TransientModel):
'Show Used Lots on Picking Operations',
implied_group='stock_ux.group_operation_used_lots',
)

delivery_slip_use_origin = fields.Boolean(
'En Comprobantes de Transferencia usar Descripción de Origen'
)

def get_values(self):
res = super(ResConfigSettings, self).get_values()
get_param = self.env['ir.config_parameter'].sudo().get_param
res.update(delivery_slip_use_origin=bool(get_param('stock_ux.delivery_slip_use_origin', False)))
return res

def set_values(self):
super(ResConfigSettings, self).set_values()
set_param = self.env['ir.config_parameter'].sudo().set_param
set_param('stock_ux.delivery_slip_use_origin', self.delivery_slip_use_origin)
14 changes: 14 additions & 0 deletions stock_ux/wizards/res_config_settings_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@
<xpath expr="//field[@name='stock_mail_confirmation_template_id']/../../.." position="attributes">
<attribute name="invisible">True</attribute>
</xpath>

<xpath expr="//div[@data-key='stock']/div[1]" position="inside">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="delivery_slip_use_origin"/>
</div>
<div class="o_setting_right_pane">
<label for="delivery_slip_use_origin"/>
<div class="text-muted">
Imprimir en el reporte de transeferencias el la Descripcion de Origen
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

0 comments on commit 8556337

Please sign in to comment.