Compare commits

...

4 Commits

Author SHA1 Message Date
guanhuan
128bebf338 紧急采购默认为是 2025-04-25 14:57:56 +08:00
guanhuan
151bc5da4f 报价菜单修改 2025-04-22 15:43:14 +08:00
guanhuan
66c745af3c 排序优化 2025-04-18 13:22:25 +08:00
guanhuan
9cfc8418ec 优化库存排序 2025-04-17 13:44:25 +08:00
9 changed files with 53 additions and 14 deletions

View File

@@ -19,7 +19,6 @@ from odoo.addons.sf_mrs_connect.models.ftp_operate import FtpController
class ResMrpWorkOrder(models.Model): class ResMrpWorkOrder(models.Model):
_inherit = 'mrp.workorder' _inherit = 'mrp.workorder'
_order = 'sequence asc'
_description = '工单' _description = '工单'
product_tmpl_name = fields.Char('坯料产品名称', related='production_bom_id.bom_line_ids.product_id.name') product_tmpl_name = fields.Char('坯料产品名称', related='production_bom_id.bom_line_ids.product_id.name')
@@ -1750,6 +1749,23 @@ class ResMrpWorkOrder(models.Model):
self.check_ids.filtered(lambda ch: ch.is_inspect is True and ch.quality_state == 'waiting').write( self.check_ids.filtered(lambda ch: ch.is_inspect is True and ch.quality_state == 'waiting').write(
{'quality_state': 'none'}) {'quality_state': 'none'})
@api.model
def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
aggregate_field = 'create_date:max'
if aggregate_field not in fields:
fields.append(aggregate_field)
orderby = "create_date desc"
return super(ResMrpWorkOrder, self).read_group(
domain,
fields,
groupby,
offset=offset,
limit=limit,
orderby=orderby,
lazy=lazy
)
class CNCprocessing(models.Model): class CNCprocessing(models.Model):
_name = 'sf.cnc.processing' _name = 'sf.cnc.processing'

View File

@@ -755,6 +755,24 @@ class StockPicking(models.Model):
if move_id.product_id.tracking in ['serial', 'lot'] and not move_id.move_line_nosuggest_ids: if move_id.product_id.tracking in ['serial', 'lot'] and not move_id.move_line_nosuggest_ids:
move_id.action_show_details() move_id.action_show_details()
@api.model
def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
aggregate_field = 'create_date:max'
if aggregate_field not in fields:
fields.append(aggregate_field)
orderby = "create_date desc"
return super(StockPicking, self).read_group(
domain,
fields,
groupby,
offset=offset,
limit=limit,
orderby=orderby,
lazy=lazy
)
class ReStockMove(models.Model): class ReStockMove(models.Model):
_inherit = 'stock.move' _inherit = 'stock.move'

View File

@@ -455,7 +455,7 @@
<field name="inherit_id" ref="mrp.mrp_production_workorder_tree_editable_view"/> <field name="inherit_id" ref="mrp.mrp_production_workorder_tree_editable_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//tree" position="attributes"> <xpath expr="//tree" position="attributes">
<attribute name="default_order">sequence</attribute> <attribute name="default_order">create_date desc</attribute>
<attribute name="decoration-warning">delivery_warning == 'warning'</attribute> <attribute name="decoration-warning">delivery_warning == 'warning'</attribute>
<attribute name="decoration-danger">delivery_warning == 'overdue'</attribute> <attribute name="decoration-danger">delivery_warning == 'overdue'</attribute>
</xpath> </xpath>

View File

@@ -101,7 +101,7 @@
action="action_quotations_supply_method" action="action_quotations_supply_method"
parent="sale.sale_order_menu" parent="sale.sale_order_menu"
groups="sf_base.group_production_engineer" groups="sf_base.group_production_engineer"
sequence="2"/> sequence="20"/>
<record id="sale.menu_sale_order" model="ir.ui.menu"> <record id="sale.menu_sale_order" model="ir.ui.menu">
<field name="groups_id" eval="[(4, ref('sf_base.group_production_engineer'))]"/> <field name="groups_id" eval="[(4, ref('sf_base.group_production_engineer'))]"/>

View File

@@ -50,6 +50,9 @@
<xpath expr="//field[@name='origin']" position="after"> <xpath expr="//field[@name='origin']" position="after">
<field name="retrospect_ref"/> <field name="retrospect_ref"/>
</xpath> </xpath>
<xpath expr="//tree" position="attributes">
<attribute name="default_order">create_date desc</attribute>
</xpath>
</field> </field>
</record> </record>

View File

@@ -323,7 +323,7 @@ class RePurchaseOrder(models.Model):
contract_summary = fields.Text(string='合同概况') contract_summary = fields.Text(string='合同概况')
# 选择是否为紧急采购 # 选择是否为紧急采购
urgent_purchase = fields.Selection([('no', ''), ('yes', '')], string='紧急采购', default='no') urgent_purchase = fields.Selection([('no', ''), ('yes', '')], string='紧急采购', default='yes')
@api.depends('origin') @api.depends('origin')
def _compute_purchase_type(self): def _compute_purchase_type(self):

View File

@@ -298,6 +298,10 @@
<xpath expr="//field[@name='name']" position="attributes"> <xpath expr="//field[@name='name']" position="attributes">
<attribute name="class">purchase_order_list_name</attribute> <attribute name="class">purchase_order_list_name</attribute>
</xpath> </xpath>
<!-- 修改 tree 视图的排序规则 -->
<xpath expr="//tree" position="attributes">
<attribute name="default_order">date_approve desc</attribute>
</xpath>
</field> </field>
</record> </record>

View File

@@ -14,16 +14,14 @@
<!-- name="Orders"--> <!-- name="Orders"-->
<!-- sequence="10">--> <!-- sequence="10">-->
<!-- <menuitem id="menu_sale_quotations"-->
<!-- action="action_quotations_with_onboarding"-->
<!-- groups="sales_team.group_sale_salesman"-->
<!-- sequence="10"/>-->
<!-- <menuitem id="menu_sale_order"--> <menuitem id="sale.menu_sale_quotations"
<!-- name="Orders"--> parent="sale.sale_order_menu"
<!-- action="action_orders"--> sequence="20"/>
<!-- groups="sales_team.group_sale_salesman"-->
<!-- sequence="20"/>--> <menuitem id="sale.menu_sale_order"
parent="sale.sale_order_menu"
sequence="10"/>
<!-- <menuitem id="report_sales_team"--> <!-- <menuitem id="report_sales_team"-->

View File

@@ -432,7 +432,7 @@
<field name="name">功能刀具组装</field> <field name="name">功能刀具组装</field>
<field name="model">sf.functional.tool.assembly</field> <field name="model">sf.functional.tool.assembly</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree create="0" delete="0"> <tree create="0" delete="0" default_order="create_date desc">
<field name="assembly_order_code"/> <field name="assembly_order_code"/>
<field name="barcode_id" optional="hide"/> <field name="barcode_id" optional="hide"/>
<field name="code" optional="hide"/> <field name="code" optional="hide"/>