质量模块和库存扫码

This commit is contained in:
qihao.gong@jikimo.com
2023-07-24 11:42:15 +08:00
parent 8d024ad625
commit 3c89404543
228 changed files with 142596 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
/** @odoo-module **/
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
const { Component, onWillStart } = owl;
export class SetReservedQuantityButton extends Component {
setup() {
const user = useService('user');
onWillStart(async () => {
this.displayUOM = await user.hasGroup('uom.group_uom');
});
}
get uom() {
const [id, name] = this.props.record.data.product_uom_id || [];
return { id, name };
}
_setQuantity (ev) {
ev.stopPropagation();
this.props.record.update({ [this.props.fieldToSet]: this.props.value });
}
}
SetReservedQuantityButton.extractProps = ({ attrs }) => {
if (attrs.field_to_set) {
return { fieldToSet: attrs.field_to_set };
}
};
SetReservedQuantityButton.template = 'stock_barcode.SetReservedQuantityButtonTemplate';
registry.category('fields').add('set_reserved_qty_button', SetReservedQuantityButton);