Skip to content

Commit f098b90

Browse files
committed
[FIX] shoppingfeed_integration: Invoices not upload to shoppingfeed in some cases
1 parent efe0bd2 commit f098b90

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

shoppingfeed_integration/models/account_move.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# Copyright 2025 Juan Carlos Oñate - Tecnativa <juancarlos.onate@tecnativa.com>
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
3-
43
import io
54
import json
5+
import logging
66

77
import requests
88

99
from odoo import _, models
1010

11+
_logger = logging.getLogger(__name__)
12+
1113

1214
class AccountMove(models.Model):
1315
_inherit = "account.move"
@@ -100,8 +102,9 @@ def _shoppingfeed_auto_pay(self):
100102
active_ids=move.ids,
101103
).create({})._create_payments()
102104

103-
def action_post(self):
104-
res = super().action_post()
105-
self._shoppingfeed_upload_invoice()
106-
self._shoppingfeed_auto_pay()
107-
return res
105+
def _post(self, soft=True):
106+
posted = super()._post(soft)
107+
invoices = posted.filtered(lambda move: move.is_invoice())
108+
invoices._shoppingfeed_upload_invoice()
109+
invoices._shoppingfeed_auto_pay()
110+
return posted

0 commit comments

Comments
 (0)