Commit d810bfaf authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: erp5_invoicing: Migrate Documents from filesystem.

* Add bt5 dependencies:
  + erp5_demo_maxma_rule: Invoice*Rule rules.
* Move Documents used by several bt5 to erp5_core rather than add depends on erp5_core.
  Once migration of Products to ZODB Components will be finished, there will be moved to
  their appropriate bt5s as it would be complicated to reorganize bt5s too at this point.
  + Invoice{Line,Cell}: used by erp5_payroll.
parent 42330b0b
erp5_simulation erp5_simulation
erp5_accounting erp5_accounting
\ No newline at end of file erp5_invoicing
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>InvoiceSimulationRule</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.InvoiceSimulationRule</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.InvoiceSimulationRule</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>InvoiceTransactionSimulationRule</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.InvoiceTransactionSimulationRule</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.InvoiceTransactionSimulationRule</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>TradeModelSimulationRule</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.TradeModelSimulationRule</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.TradeModelSimulationRule</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
document.erp5.InvoiceSimulationRule
document.erp5.InvoiceTransactionSimulationRule
document.erp5.TradeModelSimulationRule
\ No newline at end of file
...@@ -33,39 +33,38 @@ from Products.ERP5Type import Permissions, PropertySheet ...@@ -33,39 +33,38 @@ from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5.Document.DeliveryCell import DeliveryCell from Products.ERP5.Document.DeliveryCell import DeliveryCell
class InvoiceCell(DeliveryCell): class InvoiceCell(DeliveryCell):
""" """
A DeliveryCell allows to define specific quantities A DeliveryCell allows to define specific quantities
for each variation of a resource in a delivery line. for each variation of a resource in a delivery line.
""" """
meta_type = 'ERP5 Invoice Cell' meta_type = 'ERP5 Invoice Cell'
portal_type = 'Invoice Cell' portal_type = 'Invoice Cell'
add_permission = Permissions.AddPortalContent add_permission = Permissions.AddPortalContent
isCell = 1 isCell = 1
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative properties # Declarative security
property_sheets = ( PropertySheet.Base security = ClassSecurityInfo()
, PropertySheet.CategoryCore security.declareObjectProtected(Permissions.AccessContentsInformation)
, PropertySheet.Arrow
, PropertySheet.Amount
, PropertySheet.ItemAggregation
, PropertySheet.Task
, PropertySheet.Movement
, PropertySheet.Price
, PropertySheet.Predicate
, PropertySheet.MappedValue
)
security.declareProtected(Permissions.AccessContentsInformation, 'isAccountable') # Declarative properties
def isAccountable(self): property_sheets = ( PropertySheet.Base
""" , PropertySheet.CategoryCore
Returns 1 if this needs to be accounted , PropertySheet.Arrow
Only account movements which are not associated to a delivery , PropertySheet.Amount
Whenever delivery is there, delivery has priority , PropertySheet.ItemAggregation
""" , PropertySheet.Task
# Never accountable , PropertySheet.Movement
return 0 , PropertySheet.Price
, PropertySheet.Predicate
, PropertySheet.MappedValue
)
security.declareProtected(Permissions.AccessContentsInformation, 'isAccountable')
def isAccountable(self):
"""
Returns 1 if this needs to be accounted
Only account movements which are not associated to a delivery
Whenever delivery is there, delivery has priority
"""
# Never accountable
return 0
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>InvoiceCell</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.InvoiceCell</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.InvoiceCell</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -33,51 +33,48 @@ from Products.ERP5Type import Permissions, PropertySheet ...@@ -33,51 +33,48 @@ from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5.Document.DeliveryLine import DeliveryLine from Products.ERP5.Document.DeliveryLine import DeliveryLine
class InvoiceLine(DeliveryLine): class InvoiceLine(DeliveryLine):
""" """
A DeliveryLine object allows to implement lines in A DeliveryLine object allows to implement lines in
Deliveries (packing list, order, invoice, etc.) Deliveries (packing list, order, invoice, etc.)
It may include a price (for insurance, for customs, for invoices,
for orders)
"""
meta_type = 'ERP5 Invoice Line'
portal_type = 'Invoice Line'
add_permission = Permissions.AddPortalContent
# Declarative security It may include a price (for insurance, for customs, for invoices,
security = ClassSecurityInfo() for orders)
security.declareObjectProtected(Permissions.AccessContentsInformation) """
meta_type = 'ERP5 Invoice Line'
portal_type = 'Invoice Line'
add_permission = Permissions.AddPortalContent
# Declarative properties # Declarative security
property_sheets = ( PropertySheet.Base security = ClassSecurityInfo()
, PropertySheet.XMLObject security.declareObjectProtected(Permissions.AccessContentsInformation)
, PropertySheet.CategoryCore
, PropertySheet.Amount
, PropertySheet.Task
, PropertySheet.ItemAggregation
, PropertySheet.Arrow
, PropertySheet.Movement
, PropertySheet.Price
, PropertySheet.VariationRange
)
# Cell Related # Declarative properties
security.declareProtected( Permissions.ModifyPortalContent, property_sheets = ( PropertySheet.Base
'newCellContent' ) , PropertySheet.XMLObject
def newCellContent(self, id, portal_type='Invoice Cell', **kw): , PropertySheet.CategoryCore
"""Overriden to specify default portal type , PropertySheet.Amount
""" , PropertySheet.Task
return self.newContent(id=id, portal_type=portal_type, **kw) , PropertySheet.ItemAggregation
, PropertySheet.Arrow
security.declareProtected( Permissions.AccessContentsInformation, , PropertySheet.Movement
'isAccountable' ) , PropertySheet.Price
def isAccountable(self): , PropertySheet.VariationRange
""" )
Invoice movements are never accountable, because they have no
impact on stock calculations.
"""
# Never accountable
return 0
# Cell Related
security.declareProtected( Permissions.ModifyPortalContent,
'newCellContent' )
def newCellContent(self, id, portal_type='Invoice Cell', **kw): # pylint: disable=redefined-builtin
"""Overriden to specify default portal type
"""
return self.newContent(id=id, portal_type=portal_type, **kw)
security.declareProtected( Permissions.AccessContentsInformation,
'isAccountable' )
def isAccountable(self):
"""
Invoice movements are never accountable, because they have no
impact on stock calculations.
"""
# Never accountable
return 0
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>InvoiceLine</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.InvoiceLine</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.InvoiceLine</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
document.erp5.InvoiceCell
document.erp5.InvoiceLine
document.erp5.Item document.erp5.Item
document.erp5.ScriptConstraint document.erp5.ScriptConstraint
\ No newline at end of file
...@@ -232,12 +232,12 @@ class AccountingTestCase(ERP5TypeTestCase): ...@@ -232,12 +232,12 @@ class AccountingTestCase(ERP5TypeTestCase):
# some default content created. # some default content created.
return ('erp5_core_proxy_field_legacy', return ('erp5_core_proxy_field_legacy',
'erp5_base', 'erp5_pdm', 'erp5_simulation', 'erp5_trade', 'erp5_base', 'erp5_pdm', 'erp5_simulation', 'erp5_trade',
'erp5_accounting', 'erp5_project', 'erp5_accounting_ui_test', 'erp5_accounting', 'erp5_project',
'erp5_ods_style', 'erp5_ods_style',
'erp5_configurator_standard_trade_template', 'erp5_configurator_standard_trade_template',
'erp5_configurator_standard_accounting_template', 'erp5_configurator_standard_accounting_template',
'erp5_configurator_standard_invoicing_template', 'erp5_invoicing', 'erp5_configurator_standard_invoicing_template',
'erp5_simulation_test') 'erp5_simulation_test', 'erp5_accounting_ui_test')
@UnrestrictedMethod @UnrestrictedMethod
def setUpLedger(self): def setUpLedger(self):
...@@ -3180,7 +3180,7 @@ class TestTransactions(AccountingTestCase): ...@@ -3180,7 +3180,7 @@ class TestTransactions(AccountingTestCase):
def getBusinessTemplateList(self): def getBusinessTemplateList(self):
return AccountingTestCase.getBusinessTemplateList(self) + \ return AccountingTestCase.getBusinessTemplateList(self) + \
('erp5_invoicing', 'erp5_simplified_invoicing') ('erp5_simplified_invoicing',)
def _resetIdGenerator(self): def _resetIdGenerator(self):
# clear all existing ids in portal ids # clear all existing ids in portal ids
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment