Skip to content
Permalink
Browse files

[IMP] purchase: keep purchase representative empty in the purchase order

 purpose of this task is do not set default purchase representative in the purchase order when the PO is created automatically.
 When the purchase order is created automatically, this purchase order would be assigned to odoobot.
 Odoobot is not a real user. so nobody notified any activity of that purchase order.
 so keep the responsible field empty when the PO is created automatically.
 Purchase manager can easily filter "unassigned" purchase order and he can assign unassigned PO to someone (real user).

Task-1940489
  • Loading branch information...
jip-odoo committed Mar 7, 2019
1 parent c07dc6e commit 17d85a128b7640ff0858428971ab9117fafda28b
@@ -28,6 +28,7 @@

<record id="rfq1" model="purchase.order">
<field name="partner_id" ref="base.res_partner_4"/>
<field name="user_id" ref="base.user_admin"/>
<field name="requisition_id" ref="requisition1"/>
</record>

@@ -43,6 +44,7 @@

<record id="rfq2" model="purchase.order">
<field name="partner_id" ref="base.res_partner_1"/>
<field name="user_id" ref="base.user_admin"/>
<field name="requisition_id" ref="requisition1"/>
</record>

@@ -93,7 +93,11 @@
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
<field name="domain">[('requisition_id','=',active_id)]</field>
<field name="context">{"default_requisition_id":active_id}</field>
<field name="context">{
"default_requisition_id":active_id,
"default_user_id": False,
}
</field>
</record>
<record model="ir.actions.act_window" id="action_purchase_requisition_list">
<field name="name">Request for Quotations</field>
@@ -102,7 +106,11 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('requisition_id','=',active_id)]</field>
<field name="context">{"default_requisition_id":active_id}</field>
<field name="context">{
"default_requisition_id":active_id,
"default_user_id": False,
}
</field>
</record>

<record model="ir.ui.view" id="view_purchase_requisition_form">
@@ -158,7 +166,7 @@
<page string="Products">
<field name="line_ids">
<tree string="Products" editable="bottom">
<field name="product_id"/>
<field name="product_id" context="{'default_purchase_requisition': 'tenders'}"/>
<field name="product_qty"/>
<field name="qty_ordered"/>
<field name="product_uom_id" string="UoM" groups="uom.group_uom"/>
@@ -264,6 +264,7 @@ def _prepare_purchase_order(self, company_id, origins, values):

return {
'partner_id': partner.id,
'user_id': False,
'picking_type_id': self.picking_type_id.id,
'company_id': company_id.id,
'currency_id': partner.with_context(force_company=company_id.id).property_purchase_currency_id.id or self.env.company_id.currency_id.id,

0 comments on commit 17d85a1

Please sign in to comment.
You can’t perform that action at this time.