| 1 |
import { defineModels, onRpc } from "@web/../tests/web_test_helpers"; |
| 2 |
import { mailModels } from "@mail/../tests/mail_test_helpers"; |
| 3 |
import { ResourceCalendar } from "./resource_calendar.data"; |
| 4 |
import { AccountMove } from "./account_move.data"; |
| 5 |
import { PosSession } from "./pos_session.data"; |
| 6 |
import { PosConfig } from "./pos_config.data"; |
| 7 |
import { PosPreset } from "./pos_preset.data"; |
| 8 |
import { ResourceCalendarAttendance } from "./resource_calendar_attendance"; |
| 9 |
import { PosOrder } from "./pos_order.data"; |
| 10 |
import { PosOrderLine } from "./pos_order_line.data"; |
| 11 |
import { PosPackOperationLot } from "./pos_pack_operation_lot.data"; |
| 12 |
import { PosPayment } from "./pos_payment.data"; |
| 13 |
import { PosPaymentMethod } from "./pos_payment_method.data"; |
| 14 |
import { PosPrinter } from "./pos_printer.data"; |
| 15 |
import { PosCategory } from "./pos_category.data"; |
| 16 |
import { PosBill } from "./pos_bill.data"; |
| 17 |
import { ResCompany } from "./res_company.data"; |
| 18 |
import { AccountTax } from "./account_tax.data"; |
| 19 |
import { AccountTaxGroup } from "./account_tax_group.data"; |
| 20 |
import { ProductTemplate } from "./product_template.data"; |
| 21 |
import { ProductProduct } from "./product_product.data"; |
| 22 |
import { ProductAttribute } from "./product_attribute.data"; |
| 23 |
import { ProductAttributeCustomValue } from "./product_attribute_custom_value.data"; |
| 24 |
import { ProductTemplateAttributeLine } from "./product_template_attribute_line.data"; |
| 25 |
import { ProductTemplateAttributeValue } from "./product_template_attribute_value.data"; |
| 26 |
import { ProductTemplateAttributeExclusion } from "./product_template_attribute_exclusion.data"; |
| 27 |
import { ProductCombo } from "./product_combo.data"; |
| 28 |
import { ProductComboItem } from "./product_combo_item.data"; |
| 29 |
import { ResUsers } from "./res_users.data"; |
| 30 |
import { ResPartner } from "./res_partner.data"; |
| 31 |
import { ProductUom } from "./product_uom.data"; |
| 32 |
import { DecimalPrecision } from "./decimal_precision.data"; |
| 33 |
import { UomUom } from "./uom_uom.data"; |
| 34 |
import { ResCountry } from "./res_country.data"; |
| 35 |
import { ResCountryState } from "./res_country_state.data"; |
| 36 |
import { ResLang } from "./res_lang.data"; |
| 37 |
import { ProductCategory } from "./product_category.data"; |
| 38 |
import { ProductPricelist } from "./product_pricelist.data"; |
| 39 |
import { ProductPricelistItem } from "./product_pricelist_item.data"; |
| 40 |
import { AccountCashRounding } from "./account_cash_rounding.data"; |
| 41 |
import { AccountFiscalPosition } from "./account_fiscal_position.data"; |
| 42 |
import { StockPickingType } from "./stock_picking_type.data"; |
| 43 |
import { ResCurrency } from "./res_currency.data"; |
| 44 |
import { PosNote } from "./pos_note.data"; |
| 45 |
import { ProductTag } from "./product_tag.data"; |
| 46 |
import { IrModuleModule } from "./ir_module_module.data"; |
| 47 |
import { AccountJournal } from "./account_journal.data"; |
| 48 |
import { IrSequence } from "./ir_sequence.data"; |
| 49 |
import { StockWarehouse } from "./stock_warehouse.data"; |
| 50 |
import { StockRoute } from "./stock_route.data"; |
| 51 |
import { BarcodeNomenclature } from "./barcode_nomenclature.data"; |
| 52 |
import { ProductAttributeValue } from "./product_attribute_value.data"; |
| 53 |
|
| 54 |
export const hootPosModels = [ |
| 55 |
ResCountry, |
| 56 |
ResCountryState, |
| 57 |
ResCurrency, |
| 58 |
ResCompany, |
| 59 |
ResPartner, |
| 60 |
ResUsers, |
| 61 |
ResLang, |
| 62 |
PosSession, |
| 63 |
PosConfig, |
| 64 |
PosPreset, |
| 65 |
ResourceCalendarAttendance, |
| 66 |
PosOrder, |
| 67 |
PosOrderLine, |
| 68 |
PosPackOperationLot, |
| 69 |
PosPayment, |
| 70 |
PosPaymentMethod, |
| 71 |
PosPrinter, |
| 72 |
PosCategory, |
| 73 |
PosBill, |
| 74 |
AccountTax, |
| 75 |
AccountTaxGroup, |
| 76 |
AccountMove, |
| 77 |
ProductCategory, |
| 78 |
ProductTemplate, |
| 79 |
ProductProduct, |
| 80 |
ProductAttribute, |
| 81 |
ProductAttributeValue, |
| 82 |
ProductAttributeCustomValue, |
| 83 |
ProductTemplateAttributeLine, |
| 84 |
ProductTemplateAttributeValue, |
| 85 |
ProductTemplateAttributeExclusion, |
| 86 |
ProductCombo, |
| 87 |
ProductComboItem, |
| 88 |
ProductUom, |
| 89 |
ProductTag, |
| 90 |
ProductPricelist, |
| 91 |
ProductPricelistItem, |
| 92 |
DecimalPrecision, |
| 93 |
StockWarehouse, |
| 94 |
StockRoute, |
| 95 |
UomUom, |
| 96 |
AccountCashRounding, |
| 97 |
AccountFiscalPosition, |
| 98 |
StockPickingType, |
| 99 |
IrSequence, |
| 100 |
PosNote, |
| 101 |
IrModuleModule, |
| 102 |
AccountJournal, |
| 103 |
ResourceCalendar, |
| 104 |
BarcodeNomenclature, |
| 105 |
]; |
| 106 |
|
| 107 |
export const definePosModels = () => { |
| 108 |
const posModelNames = hootPosModels.map((modelClass) => modelClass.prototype.constructor._name); |
| 109 |
const modelsFromMail = Object.values(mailModels).filter( |
| 110 |
(modelClass) => !posModelNames.includes(modelClass.prototype.constructor._name) |
| 111 |
); |
| 112 |
onRpc("/pos/ping", () => {}); |
| 113 |
defineModels([...modelsFromMail, ...hootPosModels]); |
| 114 |
}; |