forked from qdai123/moveopluscustom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DEV] mv_stock_qrcode: update workflow of QR-Code Scanner, Progress: 87%
- Loading branch information
Phat Dang (MoveoPlus)
committed
Apr 18, 2024
1 parent
fc3388d
commit 8969632
Showing
13 changed files
with
661 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
from . import controllers | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
from . import stock_barcode |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** @odoo-module **/ | ||
|
||
import { patch } from "@web/core/utils/patch"; | ||
import LineComponent from "@stock_barcode/components/line"; | ||
|
||
|
||
patch(LineComponent.prototype, { | ||
/** | ||
* @override by MOVEOPLUS | ||
* [NEW] Add new "qrCode" && "inventoryPeriod" | ||
*/ | ||
|
||
get qrCode() { | ||
return (this.line.qr_code || ''); | ||
}, | ||
|
||
get inventoryPeriod() { | ||
return (this.line.inventory_period_id && this.line.inventory_period_id.week_number_str) || this.line.inventory_period_name || ''; | ||
}, | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** @odoo-module **/ | ||
|
||
import { _t } from "@web/core/l10n/translation"; | ||
import { patch } from "@web/core/utils/patch"; | ||
import MainComponent from "@stock_barcode/components/main"; | ||
|
||
|
||
patch(MainComponent.prototype, { | ||
|
||
setup(...args) { | ||
super.setup(...args); | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<templates xml:space="preserve"> | ||
|
||
<t t-inherit="stock_barcode.MainComponent" t-inherit-mode="extension"> | ||
<!-- Type your logic code here...--> | ||
</t> | ||
|
||
</templates> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** @odoo-module **/ | ||
|
||
import { _t } from "@web/core/l10n/translation"; | ||
import { patch } from "@web/core/utils/patch"; | ||
import LazyBarcodeCache from '@stock_barcode/lazy_barcode_cache'; | ||
|
||
|
||
patch(LazyBarcodeCache.prototype, { | ||
/** | ||
* @override by MOVEOPLUS | ||
*/ | ||
|
||
constructor(cacheData) { | ||
this.setup(...arguments); | ||
this.setCache(cacheData); | ||
}, | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** @odoo-module **/ | ||
|
||
import { _t } from "@web/core/l10n/translation"; | ||
import { patch } from "@web/core/utils/patch"; | ||
import { MainMenu } from "@stock_barcode/main_menu"; | ||
|
||
|
||
patch(MainMenu.prototype, { | ||
|
||
setup() { | ||
super.setup(); | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<templates xml:space="preserve"> | ||
|
||
<t t-inherit="stock_barcode.MainMenu" t-inherit-mode="extension"> | ||
<!-- Type your logic code here...--> | ||
</t> | ||
|
||
</templates> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** @odoo-module **/ | ||
|
||
import { _t } from "@web/core/l10n/translation"; | ||
import { patch } from "@web/core/utils/patch"; | ||
import BarcodeModel from "@stock_barcode/models/barcode_model"; | ||
|
||
|
||
patch(BarcodeModel.prototype, { | ||
/** | ||
* @override by MOVEOPLUS | ||
*/ | ||
|
||
setData(data) { | ||
super.setData(...arguments); | ||
super.setData(data); | ||
}, | ||
|
||
// GETTER | ||
|
||
get canCreateNewMoveLine() { | ||
return true; | ||
}, | ||
|
||
get useExistingMoveLine() { | ||
return true; | ||
}, | ||
|
||
// ACTIONS | ||
|
||
async processBarcode(barcode) { | ||
console.debug("MOVEOPLUS Debugging on Model: " + this.resModel); | ||
// console.debug("Print Cache: " + JSON.stringify(this.cache)); | ||
this.actionMutex.exec(() => this._processBarcode(barcode)); | ||
}, | ||
|
||
createNewLine(params) { | ||
// return this._createNewLine(params); | ||
console.debug("Params Creation: " + params); | ||
return; | ||
}, | ||
|
||
// -------------------------------------------------------------------------- | ||
// Private | ||
// -------------------------------------------------------------------------- | ||
|
||
_shouldSearchForAnotherMoveLine(code, filters) { | ||
return !code.match && filters['stock.move.line'] && !this.canCreateNewMoveLine && this.useExistingMoveLine; | ||
}, | ||
|
||
}); |
Oops, something went wrong.