Accept Merge Request #1896: (feature/优化调拨列表 -> develop)
Merge Request: 调拨列表采购订单询价单页面优化 Created By: @管欢 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @管欢 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1896
This commit is contained in:
@@ -9,6 +9,8 @@ class jikimo_purchase_tier_validation(models.Model):
|
|||||||
_name = 'purchase.order'
|
_name = 'purchase.order'
|
||||||
_inherit = ['purchase.order', 'tier.validation']
|
_inherit = ['purchase.order', 'tier.validation']
|
||||||
_description = "采购订单"
|
_description = "采购订单"
|
||||||
|
_state_from = ["draft", "to approve", "rejected"]
|
||||||
|
_state_to = ["approved"]
|
||||||
|
|
||||||
_tier_validation_buttons_xpath = "/form/header/button[@id='draft_confirm'][1]"
|
_tier_validation_buttons_xpath = "/form/header/button[@id='draft_confirm'][1]"
|
||||||
|
|
||||||
@@ -21,7 +23,7 @@ class jikimo_purchase_tier_validation(models.Model):
|
|||||||
|
|
||||||
def button_confirm(self):
|
def button_confirm(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.state in ['to approve']:
|
if record.need_validation and not record.validation_status == 'validated':
|
||||||
raise ValidationError(_('请先完成审批。'))
|
raise ValidationError(_('请先完成审批。'))
|
||||||
res = super(jikimo_purchase_tier_validation, self).button_confirm()
|
res = super(jikimo_purchase_tier_validation, self).button_confirm()
|
||||||
for record in self:
|
for record in self:
|
||||||
@@ -68,11 +70,6 @@ class jikimo_purchase_tier_validation(models.Model):
|
|||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _rejected_tier(self, tiers=False):
|
|
||||||
res = super(jikimo_purchase_tier_validation, self)._rejected_tier(tiers)
|
|
||||||
self.state = 'draft'
|
|
||||||
return res
|
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _get_under_validation_exceptions(self):
|
def _get_under_validation_exceptions(self):
|
||||||
res = super(jikimo_purchase_tier_validation, self)._get_under_validation_exceptions()
|
res = super(jikimo_purchase_tier_validation, self)._get_under_validation_exceptions()
|
||||||
|
|||||||
@@ -67,6 +67,16 @@
|
|||||||
<filter string="追溯参考" name="retrospect" domain="[]"
|
<filter string="追溯参考" name="retrospect" domain="[]"
|
||||||
context="{'group_by': 'retrospect_ref'}"/>
|
context="{'group_by': 'retrospect_ref'}"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='picking_type_id']" position="after">
|
||||||
|
<field name="product_id"
|
||||||
|
string="零件图号"
|
||||||
|
filter_domain="[('product_id.part_number', 'ilike', self)]"
|
||||||
|
/>
|
||||||
|
<field name="product_id"
|
||||||
|
string="零件名称"
|
||||||
|
filter_domain="[('product_id.part_name', 'ilike', self)]"
|
||||||
|
/>
|
||||||
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
@@ -42,20 +42,20 @@
|
|||||||
<field name="currency_id" position="after">
|
<field name="currency_id" position="after">
|
||||||
<field name="remark" attrs="{'readonly': [('state', 'in', ['purchase'])]}" string="订单备注"/>
|
<field name="remark" attrs="{'readonly': [('state', 'in', ['purchase'])]}" string="订单备注"/>
|
||||||
</field>
|
</field>
|
||||||
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="replace">
|
<xpath expr="//form/header/button[@name='action_rfq_send'][1]" position="attributes">
|
||||||
<button name="action_rfq_send" states="draft" string="通过Email发送采购单" type="object"
|
<attribute name="invisible">1</attribute>
|
||||||
context="{'send_rfq':True}" class="oe_highlight" data-hotkey="g"
|
|
||||||
groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//form/header/button[@name='action_rfq_send'][2]" position="replace">
|
<xpath expr="//form/header/button[@name='action_rfq_send'][2]" position="attributes">
|
||||||
<button name="action_rfq_send" states="sent" string="通过Email重新发送采购单" type="object"
|
<attribute name="invisible">1</attribute>
|
||||||
context="{'send_rfq':True}" data-hotkey="g"
|
|
||||||
groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
|
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//form/header/button[@name='action_rfq_send'][3]" position="replace">
|
<xpath expr="//form/header/button[@name='action_rfq_send'][3]" position="attributes">
|
||||||
<button name="action_rfq_send" states="purchase" string="通过Email发送订单" type="object"
|
<attribute name="invisible">1</attribute>
|
||||||
context="{'send_rfq':False}" data-hotkey="g"
|
</xpath>
|
||||||
groups="sf_base.group_purchase,sf_base.group_purchase_director"/>
|
<xpath expr="//form/header/button[@name='print_quotation'][1]" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//form/header/button[@name='print_quotation'][2]" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<!-- <xpath expr="//form/header/button[@name='print_quotation[1]']" position="attributes">-->
|
<!-- <xpath expr="//form/header/button[@name='print_quotation[1]']" position="attributes">-->
|
||||||
@@ -353,5 +353,9 @@
|
|||||||
</field>
|
</field>
|
||||||
<field name="view_mode">tree,kanban,form,activity</field>
|
<field name="view_mode">tree,kanban,form,activity</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="purchase.purchase_rfq" model="ir.actions.act_window">
|
||||||
|
<field name="context">{'quotation_only': True,"search_default_draft":1}</field>
|
||||||
|
</record>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
Reference in New Issue
Block a user