Skip to content

Commit

Permalink
[MIG] pos_auto_invoice_default_partner: migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
huguesdk committed Oct 30, 2024
1 parent 97cf8dd commit 11d41bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pos_auto_invoice_default_partner/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Point of Sale Automatically Invoice Default Partner",
"summary": """
Compatibility layer between pos_auto_invoice and pos_default_partner.""",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Point of Sale",
"website": "https://coopiteasy.be",
"author": "Coop IT Easy SC",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ odoo.define("pos_auto_invoice_default_partner.PaymentScreen", function (require)
// eslint-disable-next-line no-shadow
class InvoiceDefaultPartnerPaymentScreen extends PaymentScreen {
async validateOrder() {
const client = this.currentOrder.get_client();
const partner_id = this.env.pos.config.default_partner_id;
if (this.currentOrder.is_to_invoice() && !client && partner_id) {
this.currentOrder.set_client(
this.env.pos.db.get_partner_by_id(partner_id[0])
const partner = this.currentOrder.get_partner();
const default_partner_id = this.env.pos.config.default_partner_id;
if (
this.currentOrder.is_to_invoice() &&
!partner &&
default_partner_id
) {
this.currentOrder.set_partner(
this.env.pos.db.get_partner_by_id(default_partner_id[0])
);
}
return super.validateOrder(...arguments);
Expand Down

0 comments on commit 11d41bb

Please sign in to comment.