Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion addons/point_of_sale/models/pos_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,9 @@ def action_pos_order_invoice(self):
self._create_order_picking()
return self._generate_pos_order_invoice()

def _get_invoice_post_context(self):
return {"skip_invoice_sync": True}

def _generate_pos_order_invoice(self):
moves = self.env['account.move']

Expand All @@ -945,7 +948,7 @@ def _generate_pos_order_invoice(self):
new_move = order._create_invoice(move_vals)

order.state = 'invoiced'
new_move.sudo().with_company(order.company_id).with_context(skip_invoice_sync=True)._post()
new_move.sudo().with_company(order.company_id).with_context(**order._get_invoice_post_context())._post()

moves += new_move
payment_moves = order._apply_invoice_payments(order.session_id.state == 'closed')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,14 +437,8 @@ export class ProductScreen extends Component {
}
}

async loadProductFromDB() {
const { searchProductWord } = this.pos;
if (!searchProductWord) {
return;
}

this.pos.setSelectedCategory(0);
const domain = [
loadProductFromDBDomain(searchProductWord) {
return [
"|",
"|",
["name", "ilike", searchProductWord],
Expand All @@ -453,6 +447,16 @@ export class ProductScreen extends Component {
["available_in_pos", "=", true],
["sale_ok", "=", true],
];
}

async loadProductFromDB() {
const { searchProductWord } = this.pos;
if (!searchProductWord) {
return;
}

this.pos.setSelectedCategory(0);
const domain = this.loadProductFromDBDomain(searchProductWord);

const { limit_categories, iface_available_categ_ids } = this.pos.config;
if (limit_categories && iface_available_categ_ids.length > 0) {
Expand Down
13 changes: 10 additions & 3 deletions addons/point_of_sale/static/src/app/store/pos_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1846,6 +1846,9 @@ export class PosStore extends Reactive {
);
});
}
editPartnerContext(partner) {
return {};
}
/**
* @param {import("@point_of_sale/app/models/res_partner").ResPartner?} partner leave undefined to create a new partner
*/
Expand All @@ -1855,6 +1858,7 @@ export class PosStore extends Reactive {
"point_of_sale.res_partner_action_edit_pos",
{
props: { resId: partner?.id },
additionalContext: this.editPartnerContext(),
}
);
const newPartner = await this.data.read("res.partner", record.config.resIds);
Expand Down Expand Up @@ -1884,8 +1888,8 @@ export class PosStore extends Reactive {
async allowProductCreation() {
return await user.hasGroup("base.group_system");
}
async orderDetails(order) {
this.dialog.add(FormViewDialog, {
orderDetailsProps(order) {
return {
resModel: "pos.order",
resId: order.id,
onRecordSaved: async (record) => {
Expand All @@ -1898,7 +1902,10 @@ export class PosStore extends Reactive {
type: "ir.actions.act_window_close",
});
},
});
};
}
async orderDetails(order) {
this.dialog.add(FormViewDialog, this.orderDetailsProps(order));
}
async closePos() {
this._resetConnectedCashier();
Expand Down
2 changes: 2 additions & 0 deletions addons/web/tooling/_eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ addons/spreadsheet/static/src/o_spreadsheet/o_spreadsheet.js
!l10n_mx_edi_pos/**/*
!l10n_pl_reports_pos_jpk
!l10n_pl_reports_pos_jpk/**/*
!l10n_br_edi_pos
!l10n_br_edi_pos/**/*
!pos_account_reports
!pos_account_reports/**/*
!pos_blackbox_be
Expand Down