Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_onchange_partner_id(self):
.create(
{
"partner_id": self.partner_a.id,
"company_id": self.company_data["company"].id,
}
)
)
Expand All @@ -54,6 +55,7 @@ def test_onchange_partner_id(self):
"price_unit": self.product_order.list_price,
"order_id": purchase_order.id,
"taxes_id": False,
"company_id": self.company_data["company"].id,
}
)

Expand Down
8 changes: 5 additions & 3 deletions purchase_quick/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ def _complete_quick_line_vals(self, vals, lines_key=""):
"partner_id": self.partner_id.id,
}
vals_to_add.update(vals)
vals = vals_to_add
return super(PurchaseOrder, self)._complete_quick_line_vals(
vals, lines_key="order_line"
vals = super(PurchaseOrder, self)._complete_quick_line_vals(
vals_to_add, lines_key="order_line"
)
skip_play_onchanges_vals = {"company_id": self.company_id.id}
vals.update(skip_play_onchanges_vals)
return vals

def _add_quick_line(self, product, lines_key=""):
return super(PurchaseOrder, self)._add_quick_line(
Expand Down
14 changes: 12 additions & 2 deletions purchase_quick/tests/test_quick_purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ def _add_seller(cls, product, prices):

@classmethod
def _setUpBasicSaleOrder(cls):
vals = {"partner_id": cls.partner.id}
vals = {
"partner_id": cls.partner.id,
"company_id": cls.user.company_id.id,
"user_id": cls.user.id,
}
if hasattr(cls.env["purchase.order"], "order_type"):
vals["order_type"] = cls.env.ref("purchase_order_type.po_type_blanket").id
cls.po = cls.env["purchase.order"].create(vals)
Expand Down Expand Up @@ -199,7 +203,13 @@ def test_purchaser_can_edit_products(self):
While in the quick purchase interface, a purchaser with no edit rights
on product.product can still edit product.product quick quantities
"""
po = self.env["purchase.order"].create({"partner_id": self.partner.id})
po = self.env["purchase.order"].create(
{
"partner_id": self.partner.id,
"company_id": self.user.company_id.id,
"user_id": self.user.id,
}
)
ctx = {
"parent_id": po.id,
"parent_model": "purchase.order",
Expand Down