Hello, hello everyone, could someone help me with this query?
When closing the POS session, there is an "add a closing note" text box. Is it possible to save that closing note in a custom field within the session?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello, hello everyone, could someone help me with this query?
When closing the POS session, there is an "add a closing note" text box. Is it possible to save that closing note in a custom field within the session?
Thanks, it's working ...
Hello Fernando Meseguer Llera ,
When closing the POS session to save that closing note in a custom filed follow below steps.
1) Create your custom module and add below code in respective pos_seeion.py file.
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
// Code1 in Comment//
2) Add below xml code in your respective pos_sesion_views.xml file.
//Code2 in comment//
Do not forget to register your pos_session.py file in __init__.py
and xml file in your mdoule's manifest.
3) When user close the session from UI side, with Closing Note, Please refere below screenshot.
4) As you can see in below screenshot, In backend side of Session, In Custom field we can get the closing
note of closed session.
Hope this helps.
If you need any help in customization feel free to contact us.
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Code 1:
class PosSession(models.Model):
_inherit = 'pos.session'
closing_session_note = fields.Char("Close Session Note")
def _post_cash_details_message(self, state, difference, notes):
"""Over - rided method to fetch notes when session is closed
and update closing note in custom filed in backend."""
self.write({'closing_session_note' : notes})
res = super()._post_cash_details_message(state,difference,notes)
return res
Code 2:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="pos_session_form_view_inherit" model="ir.ui.view">
<field name="name">pos.session.form.view.inherit</field>
<field name="model">pos.session</field>
<field name="inherit_id" ref="point_of_sale.view_pos_session_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='stop_at']" position="after">
<field name="closing_session_note"/>
</xpath>
</field>
</record>
</odoo>
Create an account today to enjoy exclusive features and engage with our awesome community!
Přihlásit seRelated Posts | Odpovědi | Zobrazení | Aktivita | |
---|---|---|---|---|
|
1
čvc 25
|
1755 | ||
|
4
čvc 25
|
2964 | ||
|
0
bře 25
|
1102 | ||
|
2
led 25
|
2232 | ||
|
0
led 25
|
1201 |