mirror of
https://github.com/bringout/oca-ocb-pos.git
synced 2026-04-23 11:42:05 +02:00
19.0 vanilla
This commit is contained in:
parent
6e54c1af6c
commit
3ca647e428
1087 changed files with 132065 additions and 108499 deletions
|
|
@ -0,0 +1,38 @@
|
|||
import { patch } from "@web/core/utils/patch";
|
||||
import { hootPosModels } from "@point_of_sale/../tests/unit/data/generate_model_definitions";
|
||||
import { models } from "@web/../tests/web_test_helpers";
|
||||
|
||||
export class HrEmployee extends models.ServerModel {
|
||||
_name = "hr.employee";
|
||||
|
||||
_load_pos_data_fields() {
|
||||
return ["name", "user_id", "work_contact_id"];
|
||||
}
|
||||
|
||||
_records = [
|
||||
{
|
||||
id: 2,
|
||||
name: "Administrator",
|
||||
user_id: 2,
|
||||
work_contact_id: 3,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Employee1",
|
||||
user_id: 3,
|
||||
work_contact_id: 3,
|
||||
},
|
||||
];
|
||||
|
||||
_load_pos_data_read(records) {
|
||||
records.forEach((emp) => {
|
||||
if (emp.id === 2) {
|
||||
emp._role = "manager";
|
||||
} else {
|
||||
emp._role = "cashier";
|
||||
}
|
||||
});
|
||||
return records;
|
||||
}
|
||||
}
|
||||
patch(hootPosModels, [...hootPosModels, HrEmployee]);
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import { PosConfig } from "@point_of_sale/../tests/unit/data/pos_config.data";
|
||||
|
||||
PosConfig._records = PosConfig._records.map((record) => ({
|
||||
...record,
|
||||
module_pos_hr: true,
|
||||
}));
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
import { patch } from "@web/core/utils/patch";
|
||||
import { PosOrder } from "@point_of_sale/app/models/pos_order";
|
||||
|
||||
patch(PosOrder.prototype, {
|
||||
_load_pos_data_fields() {
|
||||
return [...super._load_pos_data_fields(), "employee_id"];
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
import { patch } from "@web/core/utils/patch";
|
||||
import { PosPayment } from "@point_of_sale/../tests/unit/data/pos_payment.data";
|
||||
|
||||
patch(PosPayment.prototype, {
|
||||
_load_pos_data_fields() {
|
||||
return [...super._load_pos_data_fields(), "employee_id"];
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import { patch } from "@web/core/utils/patch";
|
||||
import { PosSession } from "@point_of_sale/../tests/unit/data/pos_session.data";
|
||||
|
||||
patch(PosSession.prototype, {
|
||||
_load_pos_data_models() {
|
||||
return [...super._load_pos_data_models(), "hr.employee"];
|
||||
},
|
||||
_load_pos_data_fields() {
|
||||
return [...super._load_pos_data_fields(), "employee_id"];
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue