Browse Source

[REF] pog: remove reference to gpo

pull/174/head
robin.keunen 4 years ago
parent
commit
45b16bdeaf
  1. 2
      purchase_order_generator/models/purchase_order_generator.py
  2. 6
      purchase_order_generator/tests/test_pog.py
  3. 4
      purchase_order_generator/views/purchase_order_generator.xml

2
purchase_order_generator/models/purchase_order_generator.py

@ -71,7 +71,7 @@ class PurchaseOrderGenerator(models.Model):
)
@api.model
def generate_cpo(self):
def test_generate_pog(self):
order_line_obj = self.env["purchase.order.generator.line"]
product_ids = self.env.context.get("active_ids", [])

6
purchase_order_generator/tests/test_pog.py

@ -15,7 +15,7 @@ class TestCPO(TransactionCase):
self.pproduct2 = self.browse_ref("product.product_delivery_02")
self.ptemplate2 = self.pproduct2.product_tmpl_id
def test_generate_cpo(self):
def test_generate_pog(self):
supplierinfo_obj = self.env["product.supplierinfo"]
supplierinfo = supplierinfo_obj.search(
[
@ -33,7 +33,7 @@ class TestCPO(TransactionCase):
pog_obj = self.env["purchase.order.generator"]
pog_action = pog_obj.with_context(
active_ids=[self.ptemplate1.id]
).generate_cpo()
).test_generate_pog()
pog = pog_obj.browse(pog_action["res_id"])
pogl = pog.pog_line_ids # expect one line
@ -66,7 +66,7 @@ class TestCPO(TransactionCase):
cpo_obj = self.env["purchase.order.generator"]
cpo_action = cpo_obj.with_context(
active_ids=[self.ptemplate1.id, self.ptemplate2.id]
).generate_cpo()
).test_generate_pog()
cpo = cpo_obj.browse(cpo_action["res_id"])
po_action = cpo.create_purchase_order()
po = self.env["purchase.order"].browse(po_action["res_id"])

4
purchase_order_generator/views/purchase_order_generator.xml

@ -101,13 +101,13 @@
<!-- Actions -->
<record id="action_generate_cpo" model="ir.actions.server">
<record id="action_generate_pog" model="ir.actions.server">
<field name="name">Generate Purchase Order</field>
<field name="model_id" ref="model_purchase_order_generator"/>
<field name="binding_model_id" ref="product.model_product_template"/>
<field name="state">code</field>
<field name="code">
action = model.generate_cpo()
action = model.test_generate_pog()
</field>
</record>
</odoo>
Loading…
Cancel
Save