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 43132ed commit 6a2e2bc717b17931a4f0113f928e942a509c4f58
@@ -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>

@@ -151,6 +151,7 @@ def _prepare_tender_values(self, product_id, product_qty, product_uom, location_
return{
'origin': origin,
'date_end': values['date_planned'],
'user_id': False,
'warehouse_id': values.get('warehouse_id') and values['warehouse_id'].id or False,
'company_id': company_id.id,
'line_ids': [(0, 0, {
@@ -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 6a2e2bc

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