Skip to content

Commit

Permalink
[IMP] sale_order_import: Provide confirming order feature on Sale Ord…
Browse files Browse the repository at this point in the history
…er Import
  • Loading branch information
duongtq committed Oct 25, 2023
1 parent 1e38cbe commit 890dcf7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sale_order_import/wizard/sale_order_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class SaleOrderImport(models.TransientModel):
"res.partner", string="Shipping Address", readonly=True
)
sale_id = fields.Many2one("sale.order", string="Quotation to Update")
# Confirm order after creating Sale Order
confirm_order = fields.Boolean(default=False)

@api.onchange("order_file")
def order_file_change(self):
Expand Down Expand Up @@ -320,6 +322,9 @@ def create_order(self, parsed_order, price_source, order_filename=None):
order = soo.create(so_vals)
bdio.post_create_or_update(parsed_order, order, doc_filename=order_filename)
logger.info("Sale Order ID %d created", order.id)
if self.confirm_order:
order.action_confirm()
logger.info("Sale Order ID %d confirmed", order.id)

Check warning on line 327 in sale_order_import/wizard/sale_order_import.py

View check run for this annotation

Codecov / codecov/patch

sale_order_import/wizard/sale_order_import.py#L326-L327

Added lines #L326 - L327 were not covered by tests
return order

@api.model
Expand Down

0 comments on commit 890dcf7

Please sign in to comment.