21 changed files with 142 additions and 171 deletions
@ -0,0 +1,8 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<data> |
||||
|
<record model="res.groups" id="base.group_user"> |
||||
|
<field name="implied_ids" eval="[(4, ref('uom.group_uom'))]"/> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
@ -1,46 +0,0 @@ |
|||||
# -*- coding: utf-8 -*- |
|
||||
############################################################################# |
|
||||
# |
|
||||
# Cybrosys Technologies Pvt. Ltd. |
|
||||
# |
|
||||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|
||||
# Author: Gayathri V (Contact : odoo@cybrosys.com) |
|
||||
# |
|
||||
# You can modify it under the terms of the GNU AFFERO |
|
||||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|
||||
# |
|
||||
# This program is distributed in the hope that it will be useful, |
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|
||||
# |
|
||||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|
||||
# (AGPL v3) along with this program. |
|
||||
# If not, see <http://www.gnu.org/licenses/>. |
|
||||
# |
|
||||
############################################################################# |
|
||||
from odoo import fields, models |
|
||||
|
|
||||
|
|
||||
class PosMultiUom(models.Model): |
|
||||
""" |
|
||||
Model for managing Point of Sale (POS) Multi Unit of Measure (UoM). |
|
||||
This model represents the association between a product template and its |
|
||||
multiple unit of measure options for the Point of Sale module. |
|
||||
""" |
|
||||
_name = 'pos.multi.uom' |
|
||||
_description = 'POS Multi UoM' |
|
||||
|
|
||||
product_template_id = fields.Many2one('product.template', |
|
||||
string='Product Template', |
|
||||
help='Inverse field of one2many' |
|
||||
'field POS Multiple UoM in' |
|
||||
'product.template') |
|
||||
category_id = fields.Many2one( |
|
||||
related='product_template_id.uom_id.category_id', |
|
||||
string='UoM Category', help='Category of unit of measure') |
|
||||
uom_id = fields.Many2one('uom.uom', string='Unit Of Measure', |
|
||||
domain="[('category_id', '=', category_id)]", |
|
||||
help="Choose a UoM") |
|
||||
price = fields.Float(string='Sale Price', help="Set a price for selected " |
|
||||
"UoM") |
|
|
After Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 118 KiB |
After Width: | Height: | Size: 72 KiB |
@ -1,12 +0,0 @@ |
|||||
/** @odoo-module */ |
|
||||
import { PosStore } from "@point_of_sale/app/store/pos_store"; |
|
||||
import { patch } from "@web/core/utils/patch"; |
|
||||
|
|
||||
|
|
||||
patch(PosStore.prototype, { |
|
||||
// @Override
|
|
||||
async _processData(loadedData) { |
|
||||
await super._processData(...arguments); |
|
||||
this.pos_multi_uom = loadedData['pos.multi.uom']; |
|
||||
}, |
|
||||
}); |
|
@ -1,16 +1,16 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||
<odoo> |
<odoo> |
||||
<!-- Adding new field 'uom_id' to POS order line--> |
<!-- Adding new field 'uom_id' to POS order line--> |
||||
<record id="view_pos_pos_form" model="ir.ui.view"> |
<!-- <record id="view_pos_pos_form" model="ir.ui.view">--> |
||||
<field name="name">pos.order.view.form.inherit.product.multi.uom.pos |
<!-- <field name="name">pos.order.view.form.inherit.product.multi.uom.pos--> |
||||
</field> |
<!-- </field>--> |
||||
<field name="inherit_id" ref="point_of_sale.view_pos_pos_form"/> |
<!-- <field name="inherit_id" ref="point_of_sale.view_pos_pos_form"/>--> |
||||
<field name="model">pos.order</field> |
<!-- <field name="model">pos.order</field>--> |
||||
<field name="arch" type="xml"> |
<!-- <field name="arch" type="xml">--> |
||||
<xpath expr="//field[@name='lines']/tree/field[@name='qty']" |
<!-- <xpath expr="//field[@name='lines']/tree/field[@name='qty']"--> |
||||
position="after"> |
<!-- position="after">--> |
||||
<field name="uom_id" column_invisible="True"/> |
<!-- <field name="uom_id" column_invisible="True"/>--> |
||||
</xpath> |
<!-- </xpath>--> |
||||
</field> |
<!-- </field>--> |
||||
</record> |
<!-- </record>--> |
||||
</odoo> |
</odoo> |
||||
|
Loading…
Reference in new issue